Class: Interview::BooleanAttribute
- Defined in:
- lib/interview/boolean_attribute.rb
Instance Attribute Summary
Attributes inherited from Attribute
#align, #caption, #hide_caption, #hide_tooltip, #html_class, #link, #method, #nil_value, #on_changed, #only_for, #style, #surrounding_tag
Attributes inherited from Control
Instance Method Summary collapse
Methods inherited from Attribute
#initialize, #render, #tooltip, #value
Methods inherited from Control
#ancestors, build, definition, #find_attribute, #find_attribute!, inherited, #initialize, #render, #set_attributes, #set_defaults
Constructor Details
This class inherits a constructor from Interview::Attribute
Instance Method Details
#render_read ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/interview/boolean_attribute.rb', line 4 def render_read return '' if value.nil? html = Builder::XmlMarkup.new if value html.span '', class: 'glyphicon glyphicon-ok' else html.text! '' end return html.target! end |
#render_write ⇒ Object
15 16 17 |
# File 'lib/interview/boolean_attribute.rb', line 15 def render_write form_builder.check_box @method end |