-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editing devise users requires password field to be filled in #495
Comments
I got around this by removing the fields from the |
@chriscapetown This is not an Administrate issue. It can be solved overriding the def update
if params[:user][:password].blank?
params[:user].delete(:password)
params[:user].delete(:password_confirmation)
end
if requested_resource.update(resource_params)
redirect_to(
[namespace, requested_resource],
notice: translate_with_resource("update.success"),
)
else
render :edit, locals: {
page: Administrate::Page::Form.new(dashboard, requested_resource),
}
end
end Hope it helps. |
There are some 'same but different' ;) solutions to this problem here: |
@sivicencio’s solution can be further simplified if we remember that our def update
if params[:user][:password].blank?
params[:user].delete(:password)
params[:user].delete(:password_confirmation)
end
super
end |
Hey @chriscapetown! Did any of the solutions above help solve your issue? |
@carlosramireziii yeah the suggestion from @michelegera solved it. |
Thank you very much for sharing. I think a lot of Rails projects utilize Devise for their authentication. This code snippet should be documented in the Readme or at least be mentioned in some side note.
|
Hi,
I'm looking for some advice on how to handle this situation.
I have my Devise users model loaded into Administrate, and I need to be able to edit user information without needing to change/fill their passwords.
The validation at the moment throws:
Any ideas how I can overcome this?
The text was updated successfully, but these errors were encountered: