I would like to raise exceptions when trying to mass-assign an invalid attribute in the production environment, but only for a specific controller.
I figured I should add config.active_record.mass_assignment_sanitizer = :strict
to production.rb
, but that would raise exceptions app-wide.
Is there a way to only use the strict mode for a specific Controller?
The reason is that in normal usage I don't want the user to be server 500-errors, but there is a critical (data import) section in which I would like to rescue from the mass-assignment error and provide information to the user.
I'm running on Rails 3.2