Module: HtmlAttributes::TagHelper

Defined in:
lib/html_attributes/rails/tag_helper.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



10
11
12
13
# File 'lib/html_attributes/rails/tag_helper.rb', line 10

def self.included(base) #:nodoc:
  base.send(:alias_method, :tag_options_without_html_attributes, :tag_options)
  base.send(:alias_method, :tag_options, :tag_options_with_html_attributes)
end

Instance Method Details

#tag_options_with_html_attributes(options, escape = true) ⇒ Object

:nodoc:



15
16
17
18
# File 'lib/html_attributes/rails/tag_helper.rb', line 15

def tag_options_with_html_attributes(options, escape = true) #:nodoc:
  options = ::Hash[options.map { |key, value| [key, value.respond_to?("to_#{key}_attr") ? value.send("to_#{key}_attr") : value] }] unless options.blank?
  tag_options_without_html_attributes(options, escape)
end