Change row font on click

Here is the code to develop my table:

<% reports.each do |report| %> "> <% if !report.old? %> <% else %> <% end %> <% end %>
Name Date Age Procedure
<%=h "#{report.last}, #{report.first}" %> <%=h report.date %><%=h report.age %><%=h report.age %><%=h report.proc %>

It’s really standard, nothing fancy.
I’d like to be able to click on a row and change the texts in all cells
to strike-through (and possibly, remove the strike-through when you
click again).

What should I look for online… Or how do I do it?

Aldric G. wrote:>

It’s really standard, nothing fancy.
I’d like to be able to click on a row and change the texts in all cells
to strike-through (and possibly, remove the strike-through when you
click again).

What should I look for online… Or how do I do it?

Aldric,

take a look at prototype’s Element.observe functionality, you can
register a handler to change an element’s class when it is clicked…

Element.observe(“id of element”, “click” function(e) {
e.addClassName(“css_class_name_you_provided_for_strikethrough”)
})

There is also removeClassName and toggle which you should look at for
the alternate case…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs