From bd9f148d2403d14965cca76ef23d280f85a4a126 Mon Sep 17 00:00:00 2001 From: Hiroki Yoshioka Date: Fri, 15 Apr 2011 15:39:54 +0800 Subject: [PATCH] Allow to override the path after resending confirmation instructions. --- app/controllers/devise/confirmations_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/devise/confirmations_controller.rb b/app/controllers/devise/confirmations_controller.rb index 6984e6a4..3ee92436 100644 --- a/app/controllers/devise/confirmations_controller.rb +++ b/app/controllers/devise/confirmations_controller.rb @@ -13,7 +13,7 @@ class Devise::ConfirmationsController < 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_resending_confirmation_instructions_path_for(resource_name) else respond_with_navigational(resource){ render_with_scope :new } end @@ -31,4 +31,11 @@ class Devise::ConfirmationsController < ApplicationController respond_with_navigational(resource.errors, :status => :unprocessable_entity){ render_with_scope :new } end end + + protected + + # The path used after resending confirmation instructions. + def after_resending_confirmation_instructions_path_for(resource_name) + new_session_path(resource_name) + end end