Created
October 15, 2014 10:23
-
-
Save jaimeiniesta/411962976c72dbfe72be to your computer and use it in GitHub Desktop.
devise: custom after sign in path
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 AdminUser < ActiveRecord::Base | |
def after_sign_in_path | |
"/backend" | |
end | |
end |
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 | |
# Override devise to redirect after sign in | |
def after_sign_in_path_for(user) | |
user.after_sign_in_path | |
end | |
end |
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 User < ActiveRecord::Base | |
def after_sign_in_path | |
"/faqs" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment