route: allow standard path helper to work

for example `form_with model: [:instructeur, procedure, export_template]`
This commit is contained in:
simon lehericey 2024-07-18 17:27:19 +02:00
parent 248da3a896
commit 30e79b735d
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 9 additions and 6 deletions

View file

@ -22,5 +22,5 @@
= link_to download_export_path(export_template_id: export_template.id), role: 'menuitem', data: { turbo_method: :post, turbo: true } do
= "Exporter à partir du modèle #{export_template.name}"
- menu.with_item do
= link_to new_instructeur_export_template_path(procedure_id: params[:procedure_id]), role: 'menuitem' do
= link_to [:new, :instructeur, @procedure, :export_template], role: 'menuitem' do
Ajouter un modèle d'export

View file

@ -443,14 +443,17 @@ Rails.application.routes.draw do
#
scope module: 'instructeurs', as: 'instructeur' do
resources :procedures, only: [] do
resources :export_templates, only: [:new, :create, :edit, :update, :destroy] do
collection do
get 'preview'
end
end
end
resources :procedures, only: [:index, :show], param: :procedure_id do
member do
resources :archives, only: [:index, :create]
resources :export_templates, only: [:new, :create, :edit, :update, :destroy] do
collection do
get 'preview'
end
end
resources :groupes, only: [:index, :show], controller: 'groupe_instructeurs' do
resource :contact_information