ruby on rails - link_to => undefined method path -
i have created object events , have refactored controller. have :
the view :
<td><%= link_to 'show', event %></td>
the route :
scope 'admin', :module => 'back', :as => 'back' root :to => 'events#index' resources :events end
the controller :
class back::eventscontroller < backcontroller
but have error undefined method event_path. have changed link :
<td><%= link_to 'show', back_event %></td>
because when make rake routes see :
back_event /admin/events/:id(.:format) back/events#show patch /admin/events/:id(.:format) back/events#update put /admin/events/:id(.:format) back/events#update delete /admin/events/:id(.:format) back/events#destroy
but now, have error : undefined local variable or method `back_event
how can create link ?
thanks.
eric
<td><%= link_to 'show', back_event_path(event) %></td>
you need spend time reading basics: http://guides.rubyonrails.org/routing.html
Comments
Post a Comment