I'm guessing this is easy, but I still cant do it!!
In my app I have a number of different models describing events,
london_events, new_york_events, scotland_events etc etc, each of these
has columns to describe the events (Venue, time, place, band etc etc)
To display the events, I have a different page for each location (London
/ New York / Scotland), and on that page I make a table with info
columns, Event name, Band Name etc etc, and for each row (event) I want
to have the standard buttons, 'show', 'edit', 'delete'.
To keep code DRY I've made a generic view "/shared/_index_events_table"
which then gets passed all the events for the location
the generic table code looks like this:
(events_group = @london_events / @scotland_events etc etc...)
<% events_group.each do |event| %>
<td><%=h event.eventName %></td>
<td><%=h event.bandName %></td>
<td><%=h event.s3filename %></td>
<td><%= link_to 'Show', event %></td>
#This works fine, but is specific to the location
<td><%= link_to "EditOld", edit_london_events_path(event) %></td>
#How do I get to the 'edit' path for any event???
<td><%= link_to "EditNew", event/edit %></td>
<td><%= link_to "Delete", event, :method => :delete, :confirm =>
'Are you sure?',
:title => "Delete Event" %></td>
<% end %>