Bonjour,I’d like to filter the following table
Nom salle |
Nom machine |
Type d'incident |
Informations |
Etat |
Date création |
Date résolution |
Actions |
<% @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
%>
>
<%=h event.room_name %> |
<%=h event.computer_name %> |
<%=h event.type_event %> |
<%=h event.event_info %> |
<% if event.state_event=="1" %><%=h "non résolu" %> <% else
%><%=h "résolu" %> <% end %> |
<%=h event.date_creation %> |
<% if event.state_event=="1" %><%=h "non résolu" %> <% else
%><%=h event.date_resolution %><% end %> |
<%= 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 %>
|
<% end %>
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 ?