Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Current Password Requirement for Devise

I'm having an issue with the edit user section of my site. For some reason I keep getting the error "Current password can't be blank" when trying to edit a user. We use devise to manage users, but I can't seem to find code anywhere that would generate this error.

Here is the code for the form:

- semantic_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |form|
    = devise_error_messages!
    = form.semantic_errors
    = form.input :first
    = form.input :last
    = form.input :birth_year, as: :select, collection: User.birth_range.to_a.reverse
    %i= t('users.edit.cast_biometrics_hint')
    = form.input :gender, as: :select, collection: gender_options, include_blank: false
    = form.input :eye_color, as: :select, collection: eye_color_options, required: false
    = form.input :hair_color, as: :select, collection: hair_color_options, required: false
    = form.input :ethnicity, as: :select, collection: ethnicity_options, required: false
    %li.select.optional#user_height_input
      %label{for: 'user_height'} Height
      %select#user_height_ft{name: 'user[height_ft]'}
        = options_for_select 0..9, resource.height_ft
      %span ft  
      %select#user_height_in{name: 'user[height_in]'}
        = options_for_select 0..11, resource.height_in
      %span in
    = form.buttons
like image 210
Rob Avatar asked Feb 21 '23 02:02

Rob


1 Answers

There is more info in the devise wiki about this. https://github.com/plataformatec/devise/wiki/How-To%3a-Allow-users-to-edit-their-account-without-providing-a-password

like image 87
snakeyyy Avatar answered Mar 08 '23 00:03

snakeyyy