Rails_admin mass assignment error with Rails 4
Asked Answered
T

1

6

I just updated to Rails 4 and rails_admin is now giving me this when I try to edit anything and then hit 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 is not supposed to allow non-attr-accessible things to be editable but that seems to be the case.

I understand that moving to strong parameters would fix this. Is that the case? Is there a different way to fix it? Or if not can someone provide a simple explanation of how to move to strong parameters. I've tried the usual googling and reading up on it but I don't really understand what's going on and what I would need to change in my code to make the move.

Typhon answered 15/7, 2014 at 19:22 Comment(0)
M
0

Strong parameters is part of Rails since rails 4. To disable strong parameters, you can add the following line in your application.rb.

config.action_controller.permit_all_parameters = true

It is not recommended to disable strong_parameters

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

Mckinzie answered 22/6, 2015 at 14:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.