我的问题:我通过此指南添加了Facebook Omniauth(http://sourcey.com/rails-4-yomniaut--using-devise-with-with-with-twitter-facebook-and-face-and-linkedin/)。Omniauth工作,但是我需要在sign_in之后重定向用户到URL,用户单击Facebook按钮。
在OmniautCallbackScontroller中,我有方法:
def after_sign_in_path_for(resource)
if resource.email_verified?
super resource
else
finish_signup_path(resource)
end
结束
当我将"超级资源"更改为" profiles_path"时,它将我重定向到propiles页面。
如何将重定向重定向到当前页面?
将用户重定向到他单击Facebook按钮的URL:
redirect_to request.referer