because I am a grasshopper…
Now that I can sort my ‘list’…is there a logical way of not repeating
myself to having essentially the same list view with multiple sorts?
ordered by clients last name
@placement_pages, @placements = paginate( :placements, :include => [:client], :order_by => 'clients.last_name', :per_page => 14)
ordered by facility
@placement_pages, @placements = paginate( :placements, :include => [:facility], :order_by => 'facilities.name', :per_page => 14)
and then have links at the top of each column header to sort…
<%= link_to ‘Client’, :action => ‘list_cl’ %>
<%= link_to ‘Facility’, :action => ‘list_fac’ %>
Do I just have one ‘def list’ and then use something like a ‘case’
statement? If so, how do I tell it from the link_to which value?