From e02293d60d3d6573f35dce6afc0553ba3bfad53c Mon Sep 17 00:00:00 2001 From: Neetpone <132411956+Neetpone@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:09:24 -0400 Subject: [PATCH] fix: sort tags in dropdowns by something resembling a sane order --- app/controllers/search_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 7b55ee9..86122dc 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -62,8 +62,8 @@ class SearchController < ApplicationController private def load_tags - @character_tags = Tag.where(type: 'character').pluck(:name) - @other_tags = Tag.where.not(type: 'character').pluck(:name) + @character_tags = Tag.where(type: 'character').order(name: :asc).pluck(:name) + @other_tags = Tag.where.not(type: 'character').order(name: :asc).pluck(:name) end # returns: [included tags, excluded tags]