I've gone through the documentation but I still can't get my head around the syntax/formatting.
I am pretty new in rails. I have this in my model:
attr_accessible :email, :username
Because of the changes in rails 4.0 this need to be moved over to my controller.
If I put this in my controller would it be correct(This is what I think documentation says to do but not sure if I interpreted correctly):
before_filter :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :username
end
To me something like this makes more sense, can I do this?:
protected
def permitted_paramters
params.require(:username, :email).permit(:username, :email)
end
Any suggestions appreciated, thanks.