Link_to not working?
Alright, either I need to go to bed or change careers. An incredibly simple link_to
is failing and I just can't see where.
#routes.rb
resources :wikis
#view.html.haml
= link_to @wiki.title, wiki_path(@wiki)
Errors with:
No route matches {:action=>"show", :controller=>"wikis", :id=>#<Wiki id: 10, created_by_id开发者_StackOverflow社区: 1, ...
Now I'm not doing anything crazy like overriding the primary key; anything.
Here's the associated Wikis#show route in rake routes
:
wiki GET /wikis/:id(.:format) {:action=>"show", :controller=>"wikis"}
you can try
<%= link_to @wiki.title, @wiki %>
does it works: wiki_path(@wiki.id)
?
精彩评论