Module: Phlexible::Rails::AElement

Extended by:
ActiveSupport::Concern
Defined in:
lib/phlexible/rails/a_element.rb

Overview

Calls ‘url_for` for the `href` attribute, and supports a `:back` `href` value.

Instance Method Summary collapse

Instance Method Details

#a(href:, **attrs) ⇒ Object



15
16
17
18
19
# File 'lib/phlexible/rails/a_element.rb', line 15

def a(href:, **attrs, &)
  attrs[:href] = href == :back ? _back_url : url_for(href)

  super(**attrs, &)
end