Service: sort services by name in index
This commit is contained in:
parent
4d0a920e7a
commit
bda0ca8188
2 changed files with 3 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
module NewAdministrateur
|
||||
class ServicesController < AdministrateurController
|
||||
def index
|
||||
@services = services
|
||||
@services = services.ordered
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue