I am trying to extend clearances controllers to pass through some other form elements
I have currently done the following but it doesn't appear to be working and is returning ActiveModel::ForbiddenAttributesError
class UsersController < Clearance::UsersController
private
def user_from_params
params.require(:user).permit(:first_name, :last_name, :mobile, :email, :password, :password_confirmation)
end
end
The create action calls
user_from_params, which explicitly calls the Clearanceuser_paramsto validate strong parameters. Theuser_from_paramsthat defined in the derived class is not getting called, hence the exception.You can name the strong parameters method in your derived class
user_params. The derived method will then simply override the method of the same name in the base class, regardless of the fact that the base method is private.