Last active
December 27, 2015 01:18
-
-
Save sevenseacat/7243517 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# Overwrite Devise's authenticate_user! to store where they should be redirected back to | |
def authenticate_user!(opts={}) | |
session[:user_return_to] = request.referrer | |
super(opts) | |
end | |
# Change redirect after Devise login; defaults to root_url | |
def after_sign_in_path_for(user) | |
stored_location_for(user) || dashboard_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment