Skip to content

Commit

Permalink
✨ Retourne les intitulées des réponses d'une question GlisserDeposer
Browse files Browse the repository at this point in the history
  • Loading branch information
marouria authored and cprodhomme committed Nov 14, 2024
1 parent 301fb76 commit e64c9c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/admin/questions_glisser_deposer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:supprimer_audio_modalite_reponse, :supprimer_audio_intitule,
:supprimer_zone_depot, :zone_depot, :supprimer_audio_consigne,
transcriptions_attributes: %i[id categorie ecrit audio _destroy],
reponses_attributes: %i[id illustration position type_choix position_client
reponses_attributes: %i[id illustration intitule position type_choix position_client
nom_technique _destroy]

filter :libelle
Expand Down
2 changes: 1 addition & 1 deletion app/models/question_glisser_deposer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def base_json
def reponses_fields
reponses_non_classees = reponses.map do |reponse|
illustration_url = cdn_for(reponse.illustration) if reponse.illustration.attached?
reponse.slice(:id, :position, :nom_technique, :position_client).merge(
reponse.slice(:id, :position, :nom_technique, :position_client, :intitule).merge(
'illustration' => illustration_url
)
end
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/questions_glisser_deposer/_form.html.arb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ active_admin_form_for [:admin, resource] do |f|
heading: t('.reponses') do |r|
r.input :id, as: :hidden
r.input :nom_technique
r.input :intitule
r.input :position_client
r.input :type_choix, as: :hidden, input_html: { value: :bon }
label = r.object.illustration.attached? ? t('.label_illustration') : true
Expand Down

0 comments on commit e64c9c9

Please sign in to comment.