Here is my form in template
<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>
Here is my js model
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}),
});
This is my serializer
attributes :id,:post_id,:user_id,:comments,:created_at
Here is my rails controller
@comment = Comment.new(user_id: params[:user_id],post_id: params[:post_id],comments: params[:comments])
When i submit the form throwing error as
Uncaught Error: assertion failed: Your server returned a hash with the key comments but you have no mapping for it
It is inserting into database with id(primary key), created_at and updated_at. But i couldn't see user_id, post_id
and comments
.
How can i solve it.