added sorting for archives
This commit is contained in:
parent
fd29da19e5
commit
e4bf9f829c
|
@ -34,12 +34,14 @@ class ArchivesController < ApplicationController
|
||||||
{
|
{
|
||||||
"archive-title" => archive.title,
|
"archive-title" => archive.title,
|
||||||
"statuses" => statuses,
|
"statuses" => statuses,
|
||||||
|
"sort_number" => archive.sort_number,
|
||||||
"files" => files
|
"files" => files
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
sorted = archives.sort_by{|k,v| k["sort_number"].to_i}
|
||||||
{
|
{
|
||||||
"category-title" => category.title,
|
"category-title" => category.title,
|
||||||
"archives" => archives,
|
"archives" => sorted,
|
||||||
"url_to_edit" => url_to_edit
|
"url_to_edit" => url_to_edit
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue