Alphabetically ordering

Hey -

Need a hand with a straight forward problem…

I have names of systems stored in a table and I want the user of the
application to be able to have it ascending or descending
alphabetically. Is this possible using pagination?

Thanks in advance,
Gearoid.

Yes, it’s possible. One way to do it is to make sure you pass your
sort column and order to the pagination links, then pass these params
back to find in the controller.

On Jul 17, 10:10 am, Gearoid G. [email protected]

[email protected] wrote:
Thanks for the reply. I’ll give it a shot.

order = ( params[:order] == “desc” ? “ASC” : “DESC” )

paginate :systems, :order => “name #{order}”

Gearoid G. wrote:

I have names of systems stored in a table and I want the user of the
application to be able to have it ascending or descending
alphabetically. Is this possible using pagination?