diff --git a/app/controllers/new_administrateur/services_controller.rb b/app/controllers/new_administrateur/services_controller.rb new file mode 100644 index 000000000..a4185cf88 --- /dev/null +++ b/app/controllers/new_administrateur/services_controller.rb @@ -0,0 +1,13 @@ +module NewAdministrateur + class ServicesController < AdministrateurController + def index + @services = services + end + + private + + def services + current_administrateur.services + end + end +end diff --git a/app/views/new_administrateur/services/index.html.haml b/app/views/new_administrateur/services/index.html.haml new file mode 100644 index 000000000..da3b94453 --- /dev/null +++ b/app/views/new_administrateur/services/index.html.haml @@ -0,0 +1,14 @@ +.container + %h1 Liste des Services + + %table.table + %thead + %tr + %th + nom + + %tbody + - @services.each do |service| + %tr + %td + = service.nom diff --git a/config/routes.rb b/config/routes.rb index 56601ac28..c8b8a498f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -286,6 +286,8 @@ Rails.application.routes.draw do get 'apercu' end end + + resources :services, only: [:index] end apipie