Newbie: Radiobutton onclick


#1

Hi,

I would like to make a simple html which displays the contents of a
table from a database. So I put radiobuttons near the titles of the
columns to note and do a sorting by that column. But I don’t know how
to implement that the clicking on one of the radiobuttons make the
sorting. The problem is the view part. How to give a radiobutton to
make some action on a click by the helper?

The code is:


<% for col in Product.content_columns %> <% end%> <% for prod in @product %> <% for col in Product.content_columns %> <% end %> <% end %>
<%= radio_button :index, 'head', col.name %><%= col.name %>
<%= prod.send(col.name) unless (prod.send(col.name).to_s == "") %> <%= " " if (prod.send(col.name).to_s == "") %>
-----

Thanks.

Abbath