Rails 3. Device and Omniauth post signup redirection
I am developing a user application in Rails 3 and I am using D开发者_Python百科evice and Omniauth for signup. After a user have signed up using Devise I want to either redirect to a page of my choice or create a new Profile automatically for the user.
How can I choose which URL to redirect to directly after signup (not sign in)?
Thankful for all help!
Please take a look here:
https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-up-(registration)
In my application I use following code to redirect when user sign_up
class RegistrationsController < Devise::RegistrationsController
# information why this controller exist:
# https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-up-(registration)
def thank_you
end
protected
def after_sign_up_path_for(resource)
"http://some.kind.of.url/hello"
end
def after_inactive_sign_up_path_for(resource)
url_for(:controller => :registrations, :action => :thank_you)
end
end
精彩评论