Module: Juli::Visitor::Html::TagHelper

Overview

copied from Rails

Instance Method Summary collapse

Instance Method Details

#content_tag(name, content_or_options_with_block = nil, options = nil, &block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/juli/visitor/html/tag_helper.rb', line 8

def (name, content_or_options_with_block = nil, options = nil, &block)
  if block_given?
    options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash)
    (name, block.call, options)
  else
    (name, content_or_options_with_block, options)
  end
end

#tag(name, options = nil, open = false) ⇒ Object



4
5
6
# File 'lib/juli/visitor/html/tag_helper.rb', line 4

def tag(name, options = nil, open = false)
  "<#{name}#{tag_options(options) if options}#{open ? ">" : " />"}"
end