Beautiful
Posted on July 1, 2007
def all
@order = params[:order] || number
sort_proc = case @order
when "author" then lambda {|r| [r.username.downcase, r.number]}
when "status"
"title" then lambda {|r| [r.send(@order).downcase, r.number]}
when "number" then lambda {|r| -r.number }
end
@rcrs = Rcr.find(:all).sort_by &sort_proc
end
Filed Under Uncategorized |
Leave a Comment
If you would like to make a comment, please fill out the form below.