Devise password reset issue (new_user?)
Posted
by
rabid_zombie
on Stack Overflow
See other posts from Stack Overflow
or by rabid_zombie
Published on 2012-11-20T21:29:46Z
Indexed on
2012/11/20
23:01 UTC
Read the original article
Hit count: 178
When a user's email is inputted into the forgot password form and submitted, I am receiving an error saying login can't be blank
. I looked around devise.en.yml
for this error message, but can't seem to find it anywhere.
Here is my views/devise/passwords/new.html.haml
:
%div.registration_page
%h2 Forgot your password?
= form_for(resource, :as => resource_name, :url => user_password_path, :html => { :method => :post, :id => 'forgot_pw_form', :class => 'forgot_pw' }) do |f|
%div
= f.email_field :email, :placeholder => 'Email', :autofocus => true, :autocomplete => 'off'
%div.email_error.error
%input.btn.btn-success{:type => 'submit', :value => 'Send Instructions'}
= render "devise/shared/links"
The form is posting to users/password
like it should, but I noticed that my forgot password form attaches class = 'new_user'
. Here is what my form displays:
<form accept-charset='UTF-8' action='/users/password' class='new_user' id='forgot_pw_form' method='post' novalidate='novalidate'></form>
My routes for devise (I have custom sessions and registrations controllers):
devise_for :users, :controllers => {:sessions => 'sessions', :registrations => 'registrations'}
How can I setup devise's forgot password functionality? Why am I receiving this error message and why is that class being added there?
I've tried:
- Adding my own passwords controller and adding new routes for my custom controller. Same error
- Adding my own class and id to the form. This successfully changes the id and class of the form, but reverts back to class and id of
new_user
Thanks.
© Stack Overflow or respective owner