Service: sort services by name in index

This commit is contained in:
simon lehericey 2018-04-23 10:42:30 +02:00
parent 4d0a920e7a
commit bda0ca8188
2 changed files with 3 additions and 1 deletions

View file

@ -1,7 +1,7 @@
module NewAdministrateur
class ServicesController < AdministrateurController
def index
@services = services
@services = services.ordered
end
private

View file

@ -2,6 +2,8 @@ class Service < ApplicationRecord
has_many :procedures
belongs_to :administrateur
scope :ordered, -> { order(nom: :asc) }
enum type_organisme: {
administration_centrale: 'administration_centrale',
association: 'association',