ruby - undefined local variable or method `welcome_goodbye_path' in Rails? -
i beginner in rails , trying learn using "agile web development using rails".i wanted create link webpage.this code:
<h1>hello, rails!</h1> <p> <%= time.now %> </p> <p> time <%= link_to "goodbye", welcome_goodbye_path %>! </p>
but gives error...
undefined local variable or method `welcome_goodbye_path'
what doing wrong ? code of welcome controller:
class welcomecontroller < applicationcontroller def index end def goodbye end end
this result of rake routes:
prefix verb uri pattern controller#action articles /articles(.:format) articles#index post /articles(.:format) articles#create new_article /articles/new(.:format) articles#new edit_article /articles/:id/edit(.:format) articles#edit article /articles/:id(.:format) articles#show patch /articles/:id(.:format) articles#update put /articles/:id(.:format) articles#update delete /articles/:id(.:format) articles#destroy welcome_index /welcome(.:format) welcome#index post /welcome(.:format) welcome#create new_welcome /welcome/new(.:format) welcome#new edit_welcome /welcome/:id/edit(.:format) welcome#edit welcome /welcome/:id(.:format) welcome#show patch /welcome/:id(.:format) welcome#update put /welcome/:id(.:format) welcome#update delete /welcome/:id(.:format) welcome#destroy root /
you'd have show config/routes.rb
. need in there like:
get 'goodbye', to: 'welcome#goodbye', as: 'welcome_goodbye'
Comments
Post a Comment