Subject: [Rails] Table filter
Bonjour,I'd like to filter the following table


<tr>
<th><a href=#>Nom salle</a></th>
<th><a href=#>Nom machine</a></th>
<th><a href=#>Type d'incident</a></th>
<th><a href=#>Informations</a></th>
<th id="etat"><a href=#>Etat</a></th>
<th><a href=#>Date création</a></th>
<th><a href=#>Date résolution</a></th>
<th><a href=#>Actions</a></th>
</tr>
<% @events.each do |event| %>
<% # change background for event updated less than 3 minutes ago
if 3.minutes.ago.to_formatted_s(:db) < event.date_resolution
tr_class = ' class="bg_orange"'
else
tr_class = ''
end
%>
<tr<%= tr_class %>>
<td><%=h event.room_name %></td>
<td><%=h event.computer_name %></td>
<td><%=h event.type_event %></td>
<td><%=h event.event_info %></td>
<td><% if event.state_event=="1" %><%=h "non résolu" %> <% else
%><%=h "résolu" %> <% end %></td>
<td><%=h event.date_creation %></td>
<td><% if event.state_event=="1" %><%=h "non résolu" %> <% else
%><%=h event.date_resolution %><% end %></td>
<td>
<%= link_to image_tag("icons/zoom.png", :title=>"Afficher") ,
url_for(:controller => "events", :action => "show", :id =>
event.event_id) %>
<% if current_user %>
<%= link_to image_tag("icons/edit.png", :title=>"Modifier") ,
url_for(:controller => 'events', :action => 'edit', :id =>
event.event_id) %>
<%= link_to image_tag("icons/delete.png", :title=>"Modifier"), {
:action => "destroy", :id => event.event_id}, :confirm => 'Are you
sure?', :method => :delete, :form_class=> "toto" %>
<% end %>
</td>
</tr>
<% end %>
</table>

The "Etat" row contains on each line one of the three following value :
"Avertissement", "Information", "Urgent".

I want to used 3 radio buttons (named "Avertissement",
"Information", "Urgent"). While one of the buttons is clicked, the table
only displays the matching lines. For example,
if the "Urgent" button is clicked, the table will only display the lines
with the "Urgent" cell on it. Can anyone help me ?

--
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 rubyonrails-talk@xxxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@xxxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

(C)2011 mailinglist-archive.com