Class: Conjoin::FormBuilder::CheckboxInput

Inherits:
Input
  • Object
show all
Defined in:
lib/conjoin/inputs/checkbox.rb

Instance Attribute Summary

Attributes inherited from Input

#app, #data, #options, #record

Instance Method Summary collapse

Methods inherited from Input

#errors?, #id, #initialize, #nested_name, #render

Constructor Details

This class inherits a constructor from Conjoin::FormBuilder::Input

Instance Method Details

#displayObject



4
5
6
7
8
9
10
11
# File 'lib/conjoin/inputs/checkbox.rb', line 4

def display
  options[:value]   = 'on' if data.value == true
  options[:checked] = 'checked' if data.value
  options[:type]    = :checkbox
  options[:class].gsub!(/form-control/, '')

  super
end