diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/characters/hearth_controller.rb | 2 | ||||
-rw-r--r-- | app/models/character_item.rb | 2 | ||||
-rw-r--r-- | app/views/characters/hearth/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/characters/items/index.html.erb | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/characters/hearth_controller.rb b/app/controllers/characters/hearth_controller.rb index 8cbd368..644c2e5 100644 --- a/app/controllers/characters/hearth_controller.rb +++ b/app/controllers/characters/hearth_controller.rb @@ -1,6 +1,6 @@ class Characters::HearthController < ApplicationController def index - @all_amenities = HearthAmenity.all + @all_amenities = HearthAmenity.all.order(:id) @construct_activities = Activity.where("gid like ?", "construct_%") @amenity_activities = { diff --git a/app/models/character_item.rb b/app/models/character_item.rb index 6ee13ab..5bc27c9 100644 --- a/app/models/character_item.rb +++ b/app/models/character_item.rb @@ -11,5 +11,5 @@ class CharacterItem < ApplicationRecord end end - scope :ordered_by_item_name, -> { includes(:item).order("items.name") } + scope :ordered_by_item_name, -> { includes(:item).order("LOWER(items.name)").references(:items) } end diff --git a/app/views/characters/hearth/index.html.erb b/app/views/characters/hearth/index.html.erb index a5522ad..82dfbe8 100644 --- a/app/views/characters/hearth/index.html.erb +++ b/app/views/characters/hearth/index.html.erb @@ -16,7 +16,7 @@ <p class="mb-2"><%= ha.description %></p> <% if @amenity_activities[ha.gid.to_sym] %> <%= form_with url: start_activity_path, method: :post do |f| %> - <%= f.select :id, @amenity_activities[ha.gid.to_sym].map { |a| [a.name, a.id] } %> + <%= f.select :id, @amenity_activities[ha.gid.to_sym].sort_by { |a| a.name }.map { |a| [a.name, a.id] } %> <%= f.submit "Go" %> <% end %> <% end %> diff --git a/app/views/characters/items/index.html.erb b/app/views/characters/items/index.html.erb index 20b43c0..64b58da 100644 --- a/app/views/characters/items/index.html.erb +++ b/app/views/characters/items/index.html.erb @@ -11,7 +11,7 @@ </tr> </thead> <tbody> - <% @character.equipment.each do |eq| %> + <% @character.equipment.order(:slot).each do |eq| %> <tr> <td class="table-cell-padded"><%= eq.slot.to_s %></td> <td class="table-cell-padded"><%= eq.item.name %></td> |