#order can be "date" or "score" or "user"

@order = "date" #default
@order = session[:order] if session[:order]
@order = params[:order] if params[:order]

orderby = "updated_on DESC" #default
orderby = "score DESC" if @order == "score"
orderby = "user" if @order == "user"

session[:order] = @order

@results = Stats.find(:all, :order => orderby, :conditions..........
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to