Unpermitted Parameters 500 error

87 views
Skip to first unread message

Taylor Griffin

unread,
Jan 15, 2014, 9:37:35 PM1/15/14
to rubyonra...@googlegroups.com

I have some models with lots of deeply nested attributes.

Before when I saved these models using update_attributes, I had no problems, but I recently updated to Rails 4 and started using strong parameters. Now I'm getting a `found unpermitted parameters` error.

`attr_accessible` simply ignored parameters not permitted for mass-assignment and saved the others, but I guess strong parameters works differently?

Is there any way to make Rails simply ignore the unpermitted parameters and just update the parameters that are permitted?

Removing all the unpermitted params from my model would be a huge pain.

Frederick Cheung

unread,
Jan 16, 2014, 5:07:48 AM1/16/14
to rubyonra...@googlegroups.com
You can control what happens to unpermitted parameters with the config.action_controller.action_on_unpermitted_parameters  setting (can be :raise or :log). Personally I live it on :raise - I've wasted a lot of time in the past tracking down updates silently ignoring attributes.

Fred
Reply all
Reply to author
Forward
0 new messages