Skip to content

Instantly share code, notes, and snippets.

@jaimeiniesta
Created October 15, 2014 10:23
Show Gist options
  • Save jaimeiniesta/411962976c72dbfe72be to your computer and use it in GitHub Desktop.
Save jaimeiniesta/411962976c72dbfe72be to your computer and use it in GitHub Desktop.
devise: custom after sign in path
class AdminUser < ActiveRecord::Base
def after_sign_in_path
"/backend"
end
end
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
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