diff --git a/app/controllers/solidus_friendly_promotions/admin/promotions_controller.rb b/app/controllers/solidus_friendly_promotions/admin/promotions_controller.rb index bd838a23..f76f6a79 100644 --- a/app/controllers/solidus_friendly_promotions/admin/promotions_controller.rb +++ b/app/controllers/solidus_friendly_promotions/admin/promotions_controller.rb @@ -36,6 +36,7 @@ def collection @collection = super @search = @collection.ransack(params[:q]) + @search.sorts = "name asc" if @search.sorts.empty? @collection = @search.result(distinct: true) .includes(promotion_includes) .page(params[:page]) diff --git a/app/views/solidus_friendly_promotions/admin/promotions/_table.html.erb b/app/views/solidus_friendly_promotions/admin/promotions/_table.html.erb index a3c9a82e..b14a5175 100644 --- a/app/views/solidus_friendly_promotions/admin/promotions/_table.html.erb +++ b/app/views/solidus_friendly_promotions/admin/promotions/_table.html.erb @@ -1,12 +1,12 @@
<%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:name) %> | +<%= sort_link @search, :name %> | <%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:code) %> | <%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:status) %> | <%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:usage) %> | -<%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:starts_at) %> | -<%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:expires_at) %> | +<%= sort_link @search, :starts_at %> | +<%= sort_link @search, :expires_at %> | <%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:lane) %> |
---|