Module: Rails::Htmx::Helpers
- Defined in:
- lib/rails-htmx/helpers.rb
Instance Method Summary collapse
- #htmx_attributes(attributes = {}) ⇒ Object (also: #hx)
Instance Method Details
#htmx_attributes(attributes = {}) ⇒ Object Also known as: hx
4 5 6 7 8 |
# File 'lib/rails-htmx/helpers.rb', line 4 def htmx_attributes(attributes = {}) return attributes if attributes.blank? attributes.transform_keys! { |key| "hx-#{key}" } attributes end |