diff --git a/app/controllers/admin/sorecop_taxes_controller.rb b/app/controllers/admin/sorecop_taxes_controller.rb index a67105b..4f62458 100644 --- a/app/controllers/admin/sorecop_taxes_controller.rb +++ b/app/controllers/admin/sorecop_taxes_controller.rb @@ -13,7 +13,7 @@ class Admin::SorecopTaxesController < ApplicationController def index @sorecop_taxes = SorecopTax.all - @sorecop_taxes = sort_by_sorting(@sorecop_taxes, "id DESC") + @sorecop_taxes = sort_by_sorting(@sorecop_taxes, "sorecop_cat_id ASC") respond_to do |format| format.html{ diff --git a/app/models/sorecop_tax.rb b/app/models/sorecop_tax.rb index 061dd00..66bec55 100644 --- a/app/models/sorecop_tax.rb +++ b/app/models/sorecop_tax.rb @@ -8,7 +8,7 @@ class SorecopTax < ApplicationRecord :critere_min => {:name => "Critère mini (Go)", :reorder => true}, :critere_max => {:name => "Critère maxi (Go)", :reorder => true}, :fixed_price => {:name => "Prix forfaitaire", :reorder => true, :format => :boolean}, - :sorecop_cat => {:name => "Catégorie SORECOP",member_label: :name, :reorder => false}, + :sorecop_cat => {:name => "Catégorie SORECOP",member_label: :name, :reorder => true, :sort_name => "sorecop_taxes.sorecop_cat_id"}, :price => {:name => "Prix", :reorder => false, as: :currency}, :actions => {:name => "Actions", :reorder => true} }