I am trying to allow the user to reset their password using the Devise recoverable option. This does not seem to work for me.
I am expanding Devise::PasswordsController so that it does not use the application layout.
class PasswordsController < Devise::PasswordsController layout false end
In my routes, I guarantee that my password controller is used.
devise_for :users, :controllers => {:passwords => "passwords"} resources :passwords
Here is my user model, so you see that I have an option :recoverable .
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
On my login page, I have (I use haml):
... = link_to "Forgot your password?", new_password_path(resource_name)
This link correctly returns me to http://localhost:3000/users/password/new . Here is the form that is there:
%h2 Forgot your password? = form_for(resource, as: resource_name, url: password_path(resource_name), html: { :method => :post }) do |f| = devise_error_messages! %div = f.label :email %br/ = f.email_field :email %div= f.submit "Send me reset password instructions"
However, it looks like it is trying to take me to the wrong place when I press the button. It does not work every time and does not show any messages in the server log.
It redirects me to: http://localhost:3000/passwords/user and tells me:
Routing error
No route matches "/passwords/user"
Any idea how I can proceed? I thought using a restored option should be easier than that. What am I doing wrong?
UPDATE For the record, I simply deleted everything that I did and tried to use standard development controllers, and I changed my application layout so that it did not cause errors, and everything works. So I just need a good way to remove the application layout from the reset password page.