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?
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?
Another approach you can use that avoids radio buttons would be to make
the title of each column a hyperlink with a ‘sort’ param.
Another approach you can use that avoids radio buttons would be to make
There are a bunch of AJAXy ways to do the same thing that look nicer,
but this is an easy solution.
_Kevin
disclaimer… this was all out of my head, so some of the coding may
need to be tweaked.
Kevin, I was lurking on the your answer. It will make my app more
usefull. Thanks.
FYI – :order => :sort is actually :order => params[:sort]
Thanks again,
Greg
Greg F.
The Norcross Group
Forensics for the 21st Century
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.