Class: TabsFor::Rails::TabsForHelper::PaneBuilder

Inherits:
ViewBuilder
  • Object
show all
Defined in:
app/helpers/tabs_for/rails/tabs_for_helper.rb

Instance Attribute Summary

Attributes inherited from ViewBuilder

#object, #output_buffer, #template

Instance Method Summary collapse

Methods inherited from ViewBuilder

#initialize

Constructor Details

This class inherits a constructor from TabsFor::Rails::TabsForHelper::ViewBuilder

Instance Method Details

#tab(attribute, options = {}, &block) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'app/helpers/tabs_for/rails/tabs_for_helper.rb', line 87

def tab(attribute, options = {}, &block)
  content = ''.html_safe

  if options[:help]
    content += tag(:br)
    content += (:p) do
      (:i, " #{options[:help]}".html_safe, class: 'fa fa-info-circle')
    end
  end

  content += template.capture(&block)

  (:div, content, apply_options(attribute, options))
end