use params[:stable_id]
This commit is contained in:
parent
7b02fa9353
commit
a475515f3e
3 changed files with 7 additions and 7 deletions
|
@ -35,7 +35,7 @@ class TypesDeChampEditor::ChampComponent < ApplicationComponent
|
||||||
|
|
||||||
def form_options
|
def form_options
|
||||||
{
|
{
|
||||||
url: type_de_champ_path,
|
url: admin_procedure_type_de_champ_path(procedure, type_de_champ.stable_id),
|
||||||
multipart: true,
|
multipart: true,
|
||||||
html: { id: nil, class: 'form width-100' }
|
html: { id: nil, class: 'form width-100' }
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ module Administrateurs
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
type_de_champ = @procedure.draft_revision.find_and_ensure_exclusive_use(params[:id])
|
type_de_champ = @procedure.draft_revision.find_and_ensure_exclusive_use(params[:stable_id])
|
||||||
|
|
||||||
if type_de_champ.update(type_de_champ_update_params)
|
if type_de_champ.update(type_de_champ_update_params)
|
||||||
if params[:should_render]
|
if params[:should_render]
|
||||||
|
@ -31,21 +31,21 @@ module Administrateurs
|
||||||
|
|
||||||
def move
|
def move
|
||||||
flash.notice = "Formulaire enregistré"
|
flash.notice = "Formulaire enregistré"
|
||||||
@procedure.draft_revision.move_type_de_champ(params[:id], params[:position].to_i)
|
@procedure.draft_revision.move_type_de_champ(params[:stable_id], params[:position].to_i)
|
||||||
end
|
end
|
||||||
|
|
||||||
def move_up
|
def move_up
|
||||||
flash.notice = "Formulaire enregistré"
|
flash.notice = "Formulaire enregistré"
|
||||||
@coordinate = @procedure.draft_revision.move_up_type_de_champ(params[:id])
|
@coordinate = @procedure.draft_revision.move_up_type_de_champ(params[:stable_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def move_down
|
def move_down
|
||||||
flash.notice = "Formulaire enregistré"
|
flash.notice = "Formulaire enregistré"
|
||||||
@coordinate = @procedure.draft_revision.move_down_type_de_champ(params[:id])
|
@coordinate = @procedure.draft_revision.move_down_type_de_champ(params[:stable_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@coordinate = @procedure.draft_revision.remove_type_de_champ(params[:id])
|
@coordinate = @procedure.draft_revision.remove_type_de_champ(params[:stable_id])
|
||||||
reset_procedure
|
reset_procedure
|
||||||
flash.notice = "Formulaire enregistré"
|
flash.notice = "Formulaire enregistré"
|
||||||
end
|
end
|
||||||
|
|
|
@ -464,7 +464,7 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
resources :experts, controller: 'experts_procedures', only: [:index, :create, :update, :destroy]
|
resources :experts, controller: 'experts_procedures', only: [:index, :create, :update, :destroy]
|
||||||
|
|
||||||
resources :types_de_champ, only: [:create, :update, :destroy] do
|
resources :types_de_champ, only: [:create, :update, :destroy], param: :stable_id do
|
||||||
collection do
|
collection do
|
||||||
get :estimate_fill_duration
|
get :estimate_fill_duration
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue