3
votes
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"
1
can you post the contents of your config/routes.rb file?Tilo
What does your routes.rb look like?Jordan Running
OK, and how does the output of rake routes look like?Tilo
it looks fine - showing all the possibilities including /users/sign_in /users/sign_out /users/password, etc.Sergey
you created the user model? but I don't see "resources :users" in your routes...Tilo

1 Answers

3
votes

You can fix it adding a "/" before your controller name.

<%= link_to_unless_current "Home", :controller => "/items", :action => "index" %>