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
精彩评论