Class: Nitro::Form::CheckboxControl

Inherits:
Control
  • Object
show all
Defined in:
lib/nitro/helper/form/controls.rb

Overview

CheckboxControl < Control

Instance Attribute Summary

Attributes inherited from Control

#obj, #prop, #value

Instance Method Summary collapse

Methods inherited from Control

fetch, #initialize, #label, #on_populate

Methods included from XhtmlHelper

#date_select, #datetime_select, #hidden, #href_of, #js_popup, #link_to, #onclick_popup, #options, #popup, #submit, #time_select

Constructor Details

This class inherits a constructor from Nitro::Form::Control

Instance Method Details

#renderObject



164
165
166
167
# File 'lib/nitro/helper/form/controls.rb', line 164

def render
  checked = value == true ? ' checked="checked"':''
  %{<input type="checkbox" id="#{prop.symbol}_ctl" name="#{prop.symbol}" value="true"#{emit_style}#{checked}#{emit_disabled} />}
end