plataformatec/devise — Issue #1570: Password reset mail: route error
Author: pduersteler
Created: 2012-01-15 11:19:43+00:00
State: open

My devise setup (Rails 3.1.1, devise 1.5.3)

routes:
```ruby
devise_for :users, :controllers => {
:registrations => "registrations",
:sessions => "sessions"
}
```

model:
```ruby
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable
end
```

I left the reset password untouched, however when devise wants to send reset instructions, I get:

```
Started POST "/users/password" for 127.0.0.1 at 2012-01-15 12:14:25 +0100
Processing by Devise::PasswordsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"KKmGa1X2+t9efMvlpIKAbl4+R+zaXcT1XOxAQ+B8W8c=", "user"=>{"email"=>"my_email@address.com"}, "commit"=>"Passwort zurücksetzen"}
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`email` = 'my_email@address.com' LIMIT 1
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`reset_password_token` = 'nd1SiAh1isSp2p4DfDoz' LIMIT 1
(0.0ms) BEGIN
(0.3ms) UPDATE `users` SET `reset_password_token` = 'nd1SiAh1isSp2p4DfDoz', `reset_password_sent_at` = '2012-01-15 11:14:26', `updated_at` = '2012-01-15 11:14:26' WHERE `users`.`id` = 1
(73.2ms) COMMIT

Rendered devise/mailer/reset_password_instructions.html.erb (1.9ms)
Completed 500 Internal Server Error in 1178ms

ActionView::Template::Error (No route matches {}):
7:
9:

<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>

12:

app/views/devise/mailer/reset_password_instructions.html.erb:9:in `_app_views_devise_mailer_reset_password_instructions_html_erb__647539049_108294910'

```

When putting the "change my password" link into a regular view, it works. Any hints on this?