I'm a software developer that has been doing professional web application development with Ruby on Rails. These are my postings of various things that I've figured out and learned that I thought might be helpful.
@list = @list.sort_by {|s| s[params[:order]].downcase} #case-insensitive@list.reverse! if params[:direction] == "DESC"
@list = @list.sort_by {|s| (s[params[:order]].nil? ? 100.years.ago : s[params[:order]])} #datetime case
Post a Comment
No comments:
Post a Comment