Hi all,

I've got an app that displays events information, the index page lists
events in a fairly basic table with date, name, and options to edit /
delete. I'd like to display checkboxes for each row of the table, so
that a user can check multiple rows of the table, and edit the
attributes of multiple events with one click. I think the index page has
to be a form, but i'm not sure how I should structure the view, and how
I can create check boxes that correspond to attributes of the events
being displayed, currently the view looks like this:

-----

<table>
  <tr>
    <th>Date </th>
    <th>Image </th>
    <th>Event Name</th>
    <th>Band Name</th>
    <th>Venue</th>
    <th>Description</th>
  </tr>
<% events_group.each do |event| %>
  <tr class="<%= event.event_age %>">
    <td><%= event.eventDate.to_formatted_s(:short) %></td>
    <td><%=h image_tag event.photo.url(:thumb) %></td>
    <td><%=h event.eventName %></td>
    <td><%=h event.bandName %></td>
    <td><%=h event.venue %></td>
    <td><%=h event.description %></td>
  <td><%= link_to 'Show', event %></td>
  <td><%= link_to "Edit", polymorphic_path(event, :action => :edit)
%></td>
     <td><%= link_to "Delete", event, :method => :delete, :confirm =>
'Are you sure?',
                   :title => "Delete Event" %></td>
  </tr>
<% end %>
</table>

------

would the <%= form_for %> start and end tags include the whole table?

if so, the what instance variable would be in the form_for line

<%= form_for @??????    ?

I'm just not sure, conceptually, how to go about making a form to edit
the attributes of multiple object.

Thanks in advance!

MB

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to