Answer the question
In order to leave comments, you need to log in
ActiveModel::ForbiddenAttributesError in Rails 4. How to solve?
I have code in items_controller controller.
def edit
@item = Item.find(params[:id])
end
def update
@item = Item.find(params[:id])
@item.update_attributes(params[:item])
if @item.errors.empty?
redirect_to item_path(@item)
else
render "edit"
end
end
Answer the question
In order to leave comments, you need to log in
To the whitelist, all to the whitelist.
guides.rubyonrails.org/action_controller_overview....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question