Rails3 devise - 没有路线匹配“/sessions/user”
这是我第一次使用 devise,我对大量的文件和配置选项感到困惑。 在安装 devise 之前,我使用了 ryan bates 的 nifty:authentication - 在安装 devise 之前我没有删除它,我想现在我的路线和/或控制器有点搞砸了。
好吧,在 /users/sign_in devise 上唱歌后尝试将我重定向到
http://localhost:3000/sessions/user
但我收到错误:
No route matches "/sessions/user"
我不知道错误在哪里,感谢任何帮助
我将所有相关代码放在要点中: https://gist.github.com/972058
提前致谢
it is the first time I am working with devise and I am a confused by the massive amount of files and configuration options.
Before installing devise, I used the nifty:authentication from ryan bates - which I didn't delete before installing devise and I guess now my routes and/or controllers are a little screwed up.
well, after singing in on /users/sign_in devise tries to redirect me to
http://localhost:3000/sessions/user
but I get the error:
No route matches "/sessions/user"
I don't know where is the error, any help appreciated
I put all the relevant code in a gist: https://gist.github.com/972058
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就我而言,我有一个会话控制器导致了问题。从路由文件中删除资源:会话应该可以解决问题。那是因为我之前创建了一个会话管理器。一旦离开,我就没有再看到这个问题。
In my case, I had a session controller which was causing issues. Removing resources :sessions from the routes file should solve the problem. That was because I had previously created a session manager. Once gone, I did not see the issue again.
那是因为你的路由中没有根路径。正如您可以在设计页面中阅读的那样: https://github.com/plataformatec/devise
要指定重定向页面,您需要执行以下操作 https://github.com/plataformatec/devise/wiki/How-To:-重定向到成功登录时的特定页面
顺便说一句。你不需要会话控制器来使其工作
That's because you don't have root path in your routes. As you can read in devise page: https://github.com/plataformatec/devise
To specify redirect page you need to do this https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-in
btw. you don't need sessions controller to make it works