如何在我的自定义会话控制器上确定用户是第一次登录,我希望能够创建一个会话并重定向到welcome#index
它是否是第一次,否则它将被重定向到root_url
.
我拥有的代码如下
class MysessionsController < Devise::SessionsController
def create
self.resource = warden.authenticate!(auth_options)
set_flash_message(:notice, :signed_in) if is_navigational_format?
sign_in(resource_name, resource)
respond_with resource, :location => after_sign_in_path_for(resource)
end
protected
def after_sign_up_path_for(resource)
"http://google.com"
end
end
我知道我需要自定义after_sign_up_path_for(resource)
我想要的,但我无法找到如何确定用户之前是否使用设计登录