Move administrateur#update in Administrate
This commit is contained in:
parent
a6be13ac5e
commit
4f756975c7
4 changed files with 21 additions and 7 deletions
|
@ -12,10 +12,4 @@ class AdministrationsController < ApplicationController
|
|||
partial: "administrations/list",
|
||||
array: true
|
||||
end
|
||||
|
||||
def update
|
||||
Administrateur.find_inactive_by_id(params[:id]).invite!
|
||||
|
||||
redirect_to administrations_path
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,6 +13,11 @@ module Manager
|
|||
end
|
||||
end
|
||||
|
||||
def update
|
||||
Administrateur.find_inactive_by_id(params[:id]).invite!
|
||||
redirect_to manager_administrateur_path(params[:id])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def create_administrateur_params
|
||||
|
|
15
app/views/manager/administrateurs/show.html.haml
Normal file
15
app/views/manager/administrateurs/show.html.haml
Normal file
|
@ -0,0 +1,15 @@
|
|||
- content_for(:title) { page.page_title }
|
||||
|
||||
%header.header
|
||||
%h1.header__heading= content_for(:title)
|
||||
.header__actions
|
||||
- if page.resource.invitation_expired?
|
||||
= link_to "renvoyer l'invitation", manager_administrateur_path(page.resource), method: :patch, class: "button"
|
||||
|
||||
%dl
|
||||
- page.attributes.each do |attribute|
|
||||
%dt.attribute-label
|
||||
= t("helpers.label.#{resource_name}.#{attribute.name}", default: attribute.name.titleize)
|
||||
|
||||
%dd.attribute-data{ class: "attribute-data--#{attribute.html_class}" }
|
||||
= render_field attribute
|
|
@ -4,7 +4,7 @@ Rails.application.routes.draw do
|
|||
post 'whitelist', on: :member
|
||||
end
|
||||
|
||||
resources :administrateurs, only: [:index, :show, :new, :create]
|
||||
resources :administrateurs, only: [:index, :show, :new, :create, :update]
|
||||
|
||||
root to: "procedures#index"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue