這裏插入數據是我的模板形式燼軌與空字段
<form>
{{view Ember.TextArea valueBinding="comments" placeholder="Please type your comment here"}}
<div class="form-footer">
<button type="submit" class="btn pull-right btn-primary" tabindex="100" {{action saveIndianize}}>Save</button>
</div>
</form>
這裏是我的js模型
App.Comment = DS.Model.extend({
post_id: DS.attr('number'),
user_id: DS.attr('number'),
comments: DS.attr('string'),
created_at: DS.attr('date'),
job: DS.belongsTo('App.Post',{embedded:true}),
});
這是我的串行
attributes :id,:post_id,:user_id,:comments,:created_at
這裏是我的軌控制器
@comment = Comment.new(user_id: params[:user_id],post_id: params[:post_id],comments: params[:comments])
當我提交表單投擲誤差作爲
Uncaught Error: assertion failed: Your server returned a hash with the key comments but you have no mapping for it
它插入與ID(主鍵),created_at和的updated_at數據庫。但我看不到user_id, post_id
和comments
。
我該如何解決它。
什麼是ember.js和燼數據的版本? –