refactor(repetition): use row_id instead of row

This commit is contained in:
Paul Chavard 2022-12-16 15:07:26 +01:00
parent 8adada9857
commit af33d5d65c
17 changed files with 47 additions and 36 deletions

View file

@ -1,9 +1,9 @@
- row_dom_id = "row-#{SecureRandom.hex(4)}"
.row{ id: row_dom_id }
- row_id = @row.first.row_id
.row{ id: row_id }
- @row.each do |champ|
= fields_for champ.input_name, champ do |form|
= render EditableChamp::EditableChampComponent.new form: form, champ: champ, seen_at: @seen_at
.flex.row-reverse{ 'data-turbo': 'true' }
= link_to champs_repetition_path(@champ.id, champ_ids: @row.map(&:id), row_id: row_dom_id), data: { turbo_method: :delete }, class: 'fr-btn fr-btn--sm fr-btn--tertiary fr-text-action-high--red-marianne' do
= link_to champs_repetition_path(@champ.id, row_id:), data: { turbo_method: :delete }, class: 'fr-btn fr-btn--sm fr-btn--tertiary fr-text-action-high--red-marianne' do
Supprimer lélément