Skip to content

Commit

Permalink
Tidy up previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed May 24, 2010
1 parent 80977c6 commit d98882d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions app/controllers/devise/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def edit
def update
if resource.update_with_password(params[resource_name])
set_flash_message :notice, :updated
#redirect_to after_sign_in_path_for(self.resource)
redirect_to after_update_path_for(self.resource)
redirect_to after_update_path_for(resource)
else
clean_up_passwords(resource)
render_with_scope :edit
Expand Down
5 changes: 1 addition & 4 deletions lib/devise/controllers/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ def after_sign_in_path_for(resource_or_scope)
# end
# end
#

def after_update_path_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
home_path = :"#{scope}_root_path"
respond_to?(home_path, true) ? send(home_path) : root_path
after_sign_in_path_for(resource_or_scope)
end

# Method used by sessions controller to sign out an user. You can overwrite
Expand Down

0 comments on commit d98882d

Please sign in to comment.