I’m trying to figure out how to change the order of a list view and it’s
obvious to me that I don’t understand what I get from a simple scaffold
to know enough to alter it.
If someone would be so kind to tell me what this means …
@placment_pages, @placements = paginate :placements, :per_page => 10
@placement_pages, # I am guessing that this calculates the total pages
@placements = paginate :placements, # I am guessing that this calculates
# pagination from total placements /
# :per_page value
:per_page => 10 # this one is obvious to me
what I am interested in is changing the ‘order’ of things…and probably
having the most difficulty with the fact that I want the :order to be
values of a field from a related table to which this table belongs.
placements belongs_to :clients
each placement record has a value for client_id
I want to sort this placements list by placements.client.last_name
How do I do that?