新手问题 ruby-china 是怎么样在登陆后返回之前页面的?

cqcn1991 · 2013年03月17日 · 最后由 cqcn1991 回复于 2013年03月18日 · 2175 次阅读

使用 devise,应该是 overwriteafter_sign_in_path_for这个 method 但是在 github 上面搜索了 ruby-china 的代码,却并没有发现有 overwrite 很疑惑额

另外也请教怎么用 devise 返回原页面? 我查到的就是 https://github.com/plataformatec/devise/wiki/How-To:-Redirect-back-to-current-page-after-sign-in,-sign-out,-sign-up,-update

默认实现是从 session 里取的 看源码 rbcn 应该有个全局的 before_filter store_location 在 application controller 里

#1 楼 @jasl 看到了,不过没看到放到 before_filter 里面啊,就是写了 def 而已。另外吐槽一下 github 的搜索功能,应该是不能搜索session[:return_to],也不知道这个具体怎么用的……

@cqcn1991 直接代码下下来本地编辑器里看。。在网站上看总是不爽

#3 楼 @NonTwitter 哈哈,我总是太懒。其实也是 github 用得不太熟啦

需要 登录 后方可回复, 如果你还没有账号请 注册新账号