Strong parameters override the params method in ActionController::Base . You can simply redefine it and return back to what you want.
So this is:
class MyController < ApplicationController def params request.parameters end end
It will effectively turn off strong options for all actions in your controller. You only wanted to disable it for a specific action, although you could do it with:
class MyController < ApplicationController before_action :use_unsafe_params, only: [:particular_action] def params @_dangerous_params || super end def particular_action
Ritchie
source share