params.require(:xxx).permit(:a, :b, :c)
works halfway for me, that is if params[:xxx][:d]
is there, it is removed by permit
. I would like to have an exception though.
Either I did not find the documentation for that, or it is lacking. What option do I set (I would prefer one global setting) to get an exception in this case?
Well since you don't have any method that raise an exception, you can use the permitted?
method to check if it's permitted and raise an exception if the method returns false
.
EDIT: Actually you can raise an exception with:
ActionController::Parameters.action_on_unpermitted_parameters = :raise
more info at: http://api.rubyonrails.org/classes/ActionController/Parameters.html