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.

Name

Email

Website

Comments

For spam detection purposes, please copy the number 6806 to the field below:

© Copyright 0xDEADBEEFCAFE • Powered by Wordpress • Design by Sebastin.

free web hit counter