0
我新來的燼,如果我使用下面的代碼,它什麼都不顯示。Emberjs和鐵軌has_many和belongs_to
我order_controller.js
Office.OrderController = Ember.Controller.extend({
});
我customer.handlebars
{{#each order in orders}}
<tr>
<td></td>
<td>{{order.mode}}</td>
{{/each}}
我customer_route.js
Office.CustomerRoute = Ember.Route.extend({
model: function(params) {
return Office.Customer.find(params.customer_id);
},
setupController: function(controller, model) {
controller.set('content', model);
}
});
我的模型是(order.js)
Office.Order = DS.Model.extend({
mode: DS.attr('string'),
price: DS.attr('float'),
});
我的串行是order_single_serializer.rb
class OrderSingleSerializer < ActiveModel::Serializer
attributes :mode, :price
embed :ids, include: true
end