Move administrateur#update in Administrate

This commit is contained in:
Mathieu Magnin 2018-01-16 16:28:13 +01:00
parent a6be13ac5e
commit 4f756975c7
4 changed files with 21 additions and 7 deletions

View file

@ -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

View file

@ -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

View 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

View file

@ -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