I am using Rails 4.0.2 and Devise 3.2.2 to handle user registration / authentication.
I need to redirect a user to an an view page immediately after a user signs up for an account. I have try the codes from
but it doesn't work, instead I was redirected to sign in page after I sign up. Pleas see below my codes.
How can I alter devise flow to redirect the user?
Thanks!
This is my RegistrationsController :
class RegistrationsController < Devise::RegistrationsController
protected
def after_sign_up_path_for(resource)
'http://www.google.com' #to test if i was redirect to google
end
end
This is my routes.rb :
Application::Application.routes.draw do
get "registrations/update"
get "pages/home"
get "pages/privacy"
get "pages/terms"
devise_for :users, :controllers => { :registrations => "registrations" }
root "pages#home"
end
def after_inactive_sign_up_path_for(resource) 'http://google.com' end
to my RegistrationsController. Thanks BroiSatse – Jimmy