app/helpers/kpop_helper.rb in katalyst-kpop-2.0.4 vs app/helpers/kpop_helper.rb in katalyst-kpop-2.0.5

- old
+ new

@@ -11,13 +11,16 @@ def dismiss_kpop turbo_stream.update("kpop", "") end # Render a turbo frame tag that can be targeted for rendering kpop modals. - def kpop_frame_tag(&block) - turbo_frame_tag "kpop", - class: "kpop-container", - data: { controller: "kpop", action: "scrim:hide@window->kpop#dismiss" } do + def kpop_frame_tag(**html_attributes, &block) + html_attributes[:class] ||= "kpop-container" + html_attributes[:data] ||= {} + html_attributes[:data][:controller] = "kpop" + html_attributes[:data][:action] = "scrim:hide@window->kpop#dismiss" + + turbo_frame_tag("kpop", **html_attributes) do capture(&block) if block end end # Renders a link that will navigate the kpop turbo frame to the given URL.