On Thursday, January 16, 2014 2:37:35 AM UTC, Taylor Griffin wrote: > > 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. >
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 -- 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+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e9683cba-e30b-425b-b8cc-392145908af8%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.