Method: Interview::Tooltip#build

Defined in:
lib/interview/controls/tooltip.rb

#build(b) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/interview/controls/tooltip.rb', line 6

def build(b)
  tooltip = @tooltip || find_attribute(:tooltip)
  if @style == 'box'
    b.section html_class: 'alert alert-info' do
      b.text text: tooltip
    end
  elsif @style == 'popover'
    b.space
    b.link image: 'question-sign', url: '#', html_class: 'tip', html_options: { data: { toogle: 'popover', content: tooltip } }
  else
    b.text text: tooltip, style: 'p', html_class: 'help-block'
  end
end