I recently upgraded my app from rails 3.2.13 to 4. I have been moving all mass assignment code using attr_accessible in models to strong parameters in controller. Some of the code belongs to model so I cant move them inside a controller hence cant use srong parameters. Is there any way I can deal with mass assignment in models without using protected_attributes gem? Does rails 4 have some specific fallback for these cases without going the old way of attr_accessible?
Asked
Active
Viewed 242 times
1 Answers
0
Yes, you can use protected_attributes
gem. It's however advised to create service/form objects to deal with params, because models should have no knowledge about them.

Bart
- 2,606
- 21
- 32