disabled input with PJ and insert input when PJ is deleted

This commit is contained in:
Benoit Queyron 2024-07-11 17:33:52 +02:00
parent ceedbe9c45
commit 3e4aa0cde3
No known key found for this signature in database
GPG key ID: 9E723480C7317E22
3 changed files with 20 additions and 9 deletions

View file

@ -1,9 +1,9 @@
= turbo_stream.remove dom_id(@attachment, :persisted_row)
= turbo_stream.show_all ".attachment-input-#{@attachment.id}"
- if @champ
= fields_for @champ.input_name, @champ do |form|
= turbo_stream.replace @champ.input_group_id do
= render EditableChamp::EditableChampComponent.new champ: @champ, form: form
= turbo_stream.focus_all "#attachment-multiple-empty-#{@champ.public_id} input"
- else
= turbo_stream.replace dom_id(@attachment, :edit) do
= render Attachment::EditComponent.new(**@attachment_options)
= turbo_stream.focus_all "##{dom_id(@attachment.record, @attachment.name)}"