Rails 3.1 设计插件失败
ActionView::Template::Error (No route matches {:controller=>"devise/items"}):
8: </head>
9: <body>
10: <nav>
11: <%= link_to_unless_current "Home", :controller => "items", :action => "index" %> |
12: <%= link_to_unless_current "About us", :controller => "site", :action => "about" %> |
13: <%= link_to_unless_current "Contact us", :controller => "site", :action => "contact" %>
14: </nav>
我正在尝试制作一个简单的 Rails 在线商店。我包含了设计模型 User(严格遵循 Railcasts 教程),当我尝试访问 /users/sign_in 时,我在服务器日志中收到此错误。我不明白为什么当我输入 localhost:3000/users/sign_in 时它会呈现“devise/items”。
额外: 路线.rb:
devise_for :users
get "site/about"
get "site/contact"
resources :items
root :to => "items#index"
ActionView::Template::Error (No route matches {:controller=>"devise/items"}):
8: </head>
9: <body>
10: <nav>
11: <%= link_to_unless_current "Home", :controller => "items", :action => "index" %> |
12: <%= link_to_unless_current "About us", :controller => "site", :action => "about" %> |
13: <%= link_to_unless_current "Contact us", :controller => "site", :action => "contact" %>
14: </nav>
I'm trying to make a simple rails online shop. I included devise model User(strictly following Railcasts tutorial) and when I'm trying to go to /users/sign_in I get this error in the server log. I don't understand why it renders "devise/items" when I'm typing localhost:3000/users/sign_in.
Added:
routes.rb:
devise_for :users
get "site/about"
get "site/contact"
resources :items
root :to => "items#index"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在控制器名称前添加“/”来修复它。
You can fix it adding a "/" before your controller name.