开发者

Rails _url methods

I created a controller in rails usi开发者_运维技巧ng ./script/generate controller the_name create

Then in my view I have a link_to "Link text", the_name_url

I get undefined local variable or method 'the_name'

Shouldn't this work?


Make sure you don't have any references to the_name (without url or path) in your code. Also make sure that you have added an appropriate named route to config/routes.rb.


It seems like you haven't added the correct route. Try something like:

map.resources :things
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜