refactor(condition): use dom_id with stable_id

This commit is contained in:
Paul Chavard 2022-07-13 15:38:43 +02:00
parent 0adfd92213
commit 98a0bc8c71
3 changed files with 8 additions and 3 deletions

View file

@ -1,8 +1,8 @@
- rendered = render @condition_component
- if rendered.present?
= turbo_stream.morph "conditions_type_de_champ_#{@tdc.stable_id}" do
= turbo_stream.morph dom_id(@tdc.stable_self, :conditions) do
- rendered
end
- else
= turbo_stream.remove "conditions_type_de_champ_#{@tdc.stable_id}"
= turbo_stream.remove dom_id(@tdc.stable_self, :conditions)