1

Im working with ruby 1.9.2, rails 3.1.3, devise 1.5.3, I need to change the devise routes, I already changed the default routes, like login and logout, but I need to change the others routes, for example:

http://localhost:3000/password/new

I need that, when the user click the link did you forget your password? go to:

http://localhost:3000/recovery_password

in my routes I tried:

get "recovery_password", :to => "devise/passwords#new"                                    
get 'recovery_password' => 'devise_passwords#new', :as => :new_user_password

but don't works, please help.

thanks in advance.

shime
  • 8,746
  • 1
  • 30
  • 51
suely
  • 334
  • 1
  • 8
  • 19

1 Answers1

1

try this. It should works. ;)

# change :devise_model to :users, or :admins or any name of your devise model 
devise_for :devise_model do
    get 'recovery_password' => "devise/passwords#new"
end

and you can use this in view like this.

link_to 'Forgot you password?', recovery_password_url

PS. if you have customize devise controller. You should tell the router first, and change devise controller to your customize controller name.

Rafaiel
  • 302
  • 4
  • 12
  • Now devise is update to version 2.0.0 look at github page by click [this link](https://github.com/plataformatec/devise) – Rafaiel Feb 02 '12 at 07:25