Rails_admin bulk assignment error with Rails 4

I just upgraded to Rails 4, and rails_admin now gives me this when I try to edit something, and then click save:

Can't mass-assign protected attributes for Opportunity: created_by_id, contact_information, sent_expiring_email 

From what I read here , it looks like rails_admin should not allow editable objects not accessible by attr, but that seems to be the case.

I understand that switching to strong parameters will fix this. This is true? Is there any other way to fix this? Or, if not, someone can give a simple explanation of how to move on to strong parameters. I tried a regular Google search and read on it, but I really don’t understand what is happening and what I need to change in my code in order to make a move.

+7
ruby-on-rails-4 mass-assignment strong-parameters rails-admin
source share
1 answer

Strong parameters are part of Rails from Rails 4. To disable strong parameters, you can add the following line to your application.rb.

config.action_controller.permit_all_parameters = true

Disabling strong_parameters is not recommended

You can also take a look at https://github.com/rails/protected_attributes

0
source share

All Articles