Month: July 2010
Rails sort_by and group_by
sort_by @posts.sort_by(&:date).each do |post| puts post end group_by @tasks = {} TaskList.find(:all).group_by(&:type) do |type, subtasks| @tasks[type] = subtasks.group_by(&:name) end Continue reading Rails sort_by and group_by