mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Unify how we sort SQM Categories
This commit is contained in:
parent
934d0bda0e
commit
882fa84de9
8 changed files with 57 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ class DashboardController < SqmApplicationController
|
|||
.sort
|
||||
.reverse
|
||||
|
||||
@category_presenters = SqmCategory.all.map { |sqm_category| CategoryPresenter.new(category: sqm_category) }
|
||||
@category_presenters = SqmCategory.sorted.map { |sqm_category| CategoryPresenter.new(category: sqm_category) }
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ class HomeController < ActionController::Base
|
|||
@districts = District.all.order(:name)
|
||||
@schools = School.all
|
||||
|
||||
@categories = SqmCategory.all.order(:sort_index).map { |category| CategoryPresenter.new(category: category) }
|
||||
@categories = SqmCategory.sorted.map { |category| CategoryPresenter.new(category: category) }
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
class SqmCategoriesController < SqmApplicationController
|
||||
|
||||
def show
|
||||
@categories = SqmCategory.all.order(:sort_index).map { |category| CategoryPresenter.new(category: category) }
|
||||
@categories = SqmCategory.sorted.map { |category| CategoryPresenter.new(category: category) }
|
||||
|
||||
@category = CategoryPresenter.new(category: SqmCategory.find_by_slug(params[:id]))
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue