Module: HtmlTagBuilderHelper

Included in:
ApplicationHelper, Sinatra::Base
Defined in:
lib/html-tag/adapter.rb

Instance Method Summary collapse

Instance Method Details

#xtag(name = nil, opts = {}, data = nil) ⇒ Object

tag :div, { ‘class’=>‘iform’ } do tag.div(class: :iform) { |n| … }



4
5
6
7
8
# File 'lib/html-tag/adapter.rb', line 4

def xtag name=nil, opts={}, data=nil
  return HtmlTagBuilder unless name
  data = yield(opts) if block_given?
  HtmlTagBuilder.tag name, opts, data
end