これがテンプレートの私のフォームです
<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
た。
どうすれば解決できますか。