开发者

Rails _url methods

开发者 https://www.devze.com 2023-01-29 22:17 出处:网络
I created a controller in rails usi开发者_运维技巧ng ./script/generate controller the_name create

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

精彩评论

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

关注公众号