I have an application that uses devise.
I want to re-write the new method of the devise.
so I create a new controller, is called: UserSessions.
after the login, I want to redirect to google. so I tried:
class UserSessionsController < Devise::SessionsController
def new
super if defined?(super)
self.resource = build_resource(nil, :unsafe => true)
clean_up_passwords(resource)
respond_to do |format|
format.html { redirect_to("http://www.google.com") }
end
end
end
I ran my app and login to an account, but I wasn’t redirected to google, but my site.
I think my changes of the new method are not performed.
any help appreciated.
I think you have to override the create method, not the new method