[Rails] Re: Getting started w/ Rails 4
This time there does seem to be an obsoleted part not in sync with
latest code on http://edgeguides.rubyonrails.org/getting_started.html
5.6 Saving data in the controller
@post = Post.new(params[:post])
triggers the exception
ActiveModel::ForbiddenAttributesError in PostsController#create
the line should instead be
@post = Post.new(params.require(:post).permit(:title, :text))
or something to that effect.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home