Class: ActionView::Helpers::TagHelper::TagBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/green_monkey/ext/action_view.rb

Instance Method Summary collapse

Instance Method Details

#tag_options(options, escape = true) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/green_monkey/ext/action_view.rb', line 40

def tag_options(options, escape = true)
  str = tag_options_before_green_monkey(options, escape)

  if options['itemscope'] || options[:itemscope]
    str = (str + '').sub(/itemscope=('|")itemscope('|")/, 'itemscope').html_safe
  end

  str
end

#tag_options_before_green_monkeyObject

this hack replaces itemscope=“itemscope” => itemscope to make it follow standarts (www.w3.org/TR/microdata/#typed-items)



39
# File 'lib/green_monkey/ext/action_view.rb', line 39

alias_method :tag_options_before_green_monkey, :tag_options