Skip to content

Instantly share code, notes, and snippets.

@wildfalcon
Created August 5, 2011 10:39
Show Gist options
  • Save wildfalcon/1127288 to your computer and use it in GitHub Desktop.
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
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
# 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