Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore Unpermitted Parameters in Rails 4

I have some Backbone models with lots of deeply nested attributes.

Before when I saved these models, 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 unpermitted parameters, 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 Backbone model would be a giant pain.

like image 521
niftygrifty Avatar asked Jan 15 '14 16:01

niftygrifty


1 Answers

It turns out I had the following in my config/environments/development.rb:

config.action_controller.action_on_unpermitted_parameters = :raise

Once I removed that I was okay, as the default setting is :log

like image 83
niftygrifty Avatar answered Oct 18 '22 12:10

niftygrifty