From e4bf9f829cdb7c93c392bcd42172696e944e02e5 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 15 Oct 2015 14:59:08 +0800 Subject: [PATCH] added sorting for archives --- app/controllers/archives_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index a4bf6f1..9c81ac7 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -34,12 +34,14 @@ class ArchivesController < ApplicationController { "archive-title" => archive.title, "statuses" => statuses, + "sort_number" => archive.sort_number, "files" => files } end + sorted = archives.sort_by{|k,v| k["sort_number"].to_i} { "category-title" => category.title, - "archives" => archives, + "archives" => sorted, "url_to_edit" => url_to_edit } end