Class: Interview::ScaffoldCard

Inherits:
Control
  • Object
show all
Defined in:
lib/interview/controls/scaffold_card.rb

Instance Attribute Summary

Attributes inherited from Control

#parent

Instance Method Summary collapse

Methods inherited from Control

#ancestors, #build_with_params, #find_attribute, #find_attribute!, #initialize, #set_attributes, #set_defaults

Constructor Details

This class inherits a constructor from Interview::Control

Instance Method Details

#build(b) ⇒ Object



4
5
6
7
8
# File 'lib/interview/controls/scaffold_card.rb', line 4

def build(b)
  b.meta_control pointer: self do
    yield if block_given?
  end
end

#build_child(b, control, &block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/interview/controls/scaffold_card.rb', line 10

def build_child(b, control, &block)
  control.parent = self
  b.section html_class: 'row' do
    b.section style: 'p', html_class: 'col-xs-3' do
      b.text text: control.caption, style: 'b' unless control.caption == :hide
      if control.tooltip != :hide
        b.tooltip tooltip: control.tooltip, style: :popover
      end
    end
    b.section style: 'p', html_class: 'col-xs-9' do 
      control.style = 'read' unless control.style
      super
    end
  end
end