2022-12-19 12:32:09 +01:00
|
|
|
class PrefillDescriptionsController < ApplicationController
|
|
|
|
before_action :retrieve_procedure
|
|
|
|
before_action :set_prefill_description
|
|
|
|
|
|
|
|
def edit
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
@prefill_description.update(prefill_description_params)
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.turbo_stream
|
|
|
|
format.html { render :edit }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def retrieve_procedure
|
|
|
|
@procedure = Procedure.publiees_ou_brouillons.opendata.find_by!(path: params[:path])
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_prefill_description
|
|
|
|
@prefill_description = PrefillDescription.new(@procedure)
|
|
|
|
end
|
|
|
|
|
|
|
|
def prefill_description_params
|
2023-03-02 01:14:34 +01:00
|
|
|
params.require(:procedure).permit(:selected_type_de_champ_ids, :identity_items_selected)
|
2022-12-19 12:32:09 +01:00
|
|
|
end
|
|
|
|
end
|