开发者

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) ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜