我正在开发一个应用程序,并试图找出烬。
我遵循这个:http://ember.guru/2014/master-your-modals-in-ember-js让我的情态工作,我没有问题让编辑和删除工作,但我不知道如何让创建工作。
这是我的链接编辑:<a {{action 'showModal' 'contact.addresses.modal' contactAdress}}><i class="pencil circular icon"></i></a>
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 section
this.resource('contact', {path: '/contact/:contact_id'}, function(){
this.route('personage', {path: '/'});
this.route('addresses');
...
地址是一个belongs_to to contacts
谁能给我指出正确的方向,我已经在这个工作了几天了!
路线:contact.addresses.new
export default Ember.Route.extend({
setupController: function(controller) {
controller.set('fields', {})
}
});
对于嵌套的资源,可以使用带有最后部分的路由。
查看更多:http://emberjs.com/guides/routing/defining-your-routes/#toc_nested-resources