Module: LiveComponent::ApplicationHelper
- Defined in:
- app/helpers/live_component/application_helper.rb
Instance Method Summary collapse
- #button_to(*args, rerender: nil, form: {}, **options, &block) ⇒ Object
- #content_tag(name, content_or_options_with_block = nil, options = nil, escape = true, &block) ⇒ Object
- #form_with(rerender: nil, html: {}, **options, &block) ⇒ Object
- #live ⇒ Object
Instance Method Details
#button_to(*args, rerender: nil, form: {}, **options, &block) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/live_component/application_helper.rb', line 19 def (*args, rerender: nil, form: {}, **, &block) if (params = Utils.html_params_for_rerender(rerender)) form.merge!(params) end = ::LiveComponent::Utils.translate_all_attrs() super(*args, **, form: form, &block) end |
#content_tag(name, content_or_options_with_block = nil, options = nil, escape = true, &block) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/helpers/live_component/application_helper.rb', line 29 def content_tag(name, = nil, = nil, escape = true, &block) if block_given? if .is_a?(Hash) = = nil end end ||= {} = ::LiveComponent::Utils.translate_all_attrs() super end |
#form_with(rerender: nil, html: {}, **options, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/helpers/live_component/application_helper.rb', line 9 def form_with(rerender: nil, html: {}, **, &block) if (params = Utils.html_params_for_rerender(rerender)) html.merge!(params) end = ::LiveComponent::Utils.translate_all_attrs() super(**, html: html, &block) end |
#live ⇒ Object
5 6 7 |
# File 'app/helpers/live_component/application_helper.rb', line 5 def live @__lc_tag_builder ||= LiveComponent::TagBuilder.new(self) end |