Created
August 5, 2011 10:39
-
-
Save wildfalcon/1127288 to your computer and use it in GitHub Desktop.
How to get devise to redirect to a specific page after user sign up
This file contains hidden or 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 Users::RegistrationsController < Devise::RegistrationsController | |
# Use this if you are sending a confirmation email before completing sign up | |
def after_inactive_sign_up_path_for(resource) | |
# resource is an instance of User | |
"http://www.example.com?user_id=#{resource.id}" | |
end | |
# Use this one once the account is active | |
def after_sign_up_path_for(resource) | |
# resource is an instance of User | |
"http://www.example.com?user_id=#{resource.id}" | |
end | |
end |
This file contains hidden or 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
# We need to have our own custom controller for registrations | |
devise_for :users, :controllers => { :registrations => "users/registrations" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment