0

I'm working on an app, and trying to figure out ember.

I have followed this: http://ember.guru/2014/master-your-modals-in-ember-js to getting my modals working, and I have no problem getting edit and delete to work, but I can't figure out how to get create working.

here is my link for edit:

<a {{action 'showModal' 'contact.addresses.modal' contactAdress}}><i class="pencil circular icon"></i></a>

and for create:

<div class="ui button small" {{action 'showModal' 'contact.addresses.new' ##WHAT TO PUT HERE##}}><i class="plus icon"></i> New Address</div>

my router for the section

this.resource('contact', {path: '/contact/:contact_id'}, function(){
    this.route('personage', {path: '/'});
    this.route('addresses');
    ...

the addresses is a belongs_to to contacts

Can someone please point me in the right direction, I have worked on this for days now!

UPDATE

route: contact.addresses.new

export default Ember.Route.extend({
    setupController: function(controller) {
        controller.set('fields', {})
    }
});
4

1 回答 1

0

对于嵌套资源,您可以使用带有最后部分的路由。

查看更多:http ://emberjs.com/guides/routing/defining-your-routes/#toc_nested-resources

于 2014-08-04T09:52:25.847 回答