From d56741ca4f4dc5b69b0206edb9bdedd5d84266b5 Mon Sep 17 00:00:00 2001 From: naomi Date: Fri, 13 May 2011 11:39:11 -0500 Subject: [PATCH] added ability to override redirect_to path after sending reset password instructions --- app/controllers/devise/passwords_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/devise/passwords_controller.rb b/app/controllers/devise/passwords_controller.rb index f61fece0..024972ea 100644 --- a/app/controllers/devise/passwords_controller.rb +++ b/app/controllers/devise/passwords_controller.rb @@ -14,7 +14,7 @@ class Devise::PasswordsController < ApplicationController if resource.errors.empty? set_flash_message(:notice, :send_instructions) if is_navigational_format? - respond_with resource, :location => new_session_path(resource_name) + respond_with resource, :location => after_sending_reset_password_instructions_path_for(resource_name) else respond_with_navigational(resource){ render_with_scope :new } end @@ -39,4 +39,12 @@ class Devise::PasswordsController < ApplicationController respond_with_navigational(resource){ render_with_scope :edit } end end + + protected + + # The path used after sending reset password instructions + def after_sending_reset_password_instructions_path_for(resource_name) + new_session_path(resource_name) + end + end