Skip to content

Commit

Permalink
added ability to override redirect_to path after sending reset passwo…
Browse files Browse the repository at this point in the history
…rd instructions
  • Loading branch information
naomi committed May 13, 2011
1 parent 50a5ad5 commit d56741c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/controllers/devise/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create

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
Expand All @@ -39,4 +39,12 @@ def update
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

0 comments on commit d56741c

Please sign in to comment.