Link to edit restaurant listing in Navbar
Can anyone please explain me how I can move the "Edit" restaurant link from the restaurant index page into the navbar? I want to make a dropdown in the navbar with: Edit profile, Edit listing, Sign out.
I tried this by pasting in the navbar another <li> :
<li><%= link_to "Edit Listing", edit_restaurant_path(@restaurant.restaurant_id) %></li>
But i get an error: NoMethodError in Restaurants#edit , undefined method `restaurant_id' for #<Restaurant:0x00000108aa2cc0>
I must somehow pass the :id param in the link like this: /restaurants/:id(.:format) ! ?
Can somebody help ?
Posted almost 6 years ago by