1

我的根页面是一个欢迎页面,其中包含一个打开注册模式的链接。

我有需要身份验证的特定页面。当我转到那个特定页面时,我被重定向到 localhost:3000/users/sign_in。但我想将用户重定向到我的主页并显示模式。我的意思是我希望登录页面是 localhost:3000/ 并且不知何故,只是在这种情况下传递一个参数,让我知道我必须打开弹出窗口。

我的意思是,当我转到 localhost:3000 时,我应该只显示主屏幕。

但是如果我去 localhost:3000/myspecificpagewithauthentication 我应该被重定向到 localhost:3000?showsignup=true (以便能够使用 JS 显示模式)并且在注册后我应该再次被重定向到 localhost:3000/myspecificpagewithauthentication (已经认证)。

我正在使用设计和 RoR 3。

有什么帮助吗?谢谢。

4

1 回答 1

4

设计是一个有据可查的宝石。给

更新:

要更改登录后路径,请将您自己的 after_sign_in_path_for 方法写入应用程序控制器。这将覆盖设计的方法。

class ApplicationController < ActionController::Base

def after_sign_in_path_for(resource)
  your_custom_path
end

end
于 2012-08-15T13:08:50.593 回答