diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/shared_searches_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/tags_controller.rb | 2 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2a63b66..fbe614c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -17,6 +17,6 @@ class ApplicationController < ActionController::Base end def set_searches - @searches = Search.all + @searches = Search.order(:name) end end diff --git a/app/controllers/shared_searches_controller.rb b/app/controllers/shared_searches_controller.rb index 3208e7c..066dd3e 100644 --- a/app/controllers/shared_searches_controller.rb +++ b/app/controllers/shared_searches_controller.rb @@ -4,7 +4,7 @@ class SharedSearchesController < ApplicationController skip_before_action :user_authenticated!, only: %i[show] def index - @searches = Search.where(shared: true) + @searches = Search.where(shared: true).order(:name) end def show diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index d967185..8ae36d7 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -4,7 +4,7 @@ class TagsController < ApplicationController before_action :set_tag, only: %i[destroy] def index - @tags = Tag.all + @tags = Tag.order(:name) end def new diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1027dd4..adfc426 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -29,7 +29,7 @@ <header data-controller="header"> <nav> <a class="<%= 'current' if current_user.last_search_id.nil? %>" href="/"><%= I18n.t('searches.home') %></a> - <% Search.find_each do |s| %> + <% @searches.each do |s| %> <a class="<%= 'current' if current_user.last_search_id == s.id %>" href="<%= search_path(s) %>"><%= s.name %></a> <% end %> <a id="toggle-hidden-global-menu" href="#" data-action="header#toggle"><i id="header-chevron" class="gg-chevron-down"></i></a> |
