Class: ValidationAnnotations::FormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- ValidationAnnotations::FormBuilder
- Defined in:
- lib/validation_annotations/form_builder.rb
Instance Method Summary collapse
- #check_box(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
- #check_boxes(method, options, &block) ⇒ Object
-
#initialize(object_name, object, template, options, proc) ⇒ FormBuilder
constructor
A new instance of FormBuilder.
- #password_field(method, options = {}) ⇒ Object
- #radio_buttons(method, options, &block) ⇒ Object
- #text_area(method, options = {}) ⇒ Object
- #text_field(method, options = {}) ⇒ Object
Constructor Details
#initialize(object_name, object, template, options, proc) ⇒ FormBuilder
Returns a new instance of FormBuilder.
6 7 8 9 |
# File 'lib/validation_annotations/form_builder.rb', line 6 def initialize(object_name, object, template, , proc) @skip_annotations = ![:validation_annotations].nil? && [:validation_annotations] === false super(object_name, object, template, , proc) end |
Instance Method Details
#check_box(method, options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
11 12 13 14 |
# File 'lib/validation_annotations/form_builder.rb', line 11 def check_box(method, = {}, checked_value = "1", unchecked_value = "0") = (method, ) super(method, , checked_value, unchecked_value) end |
#check_boxes(method, options, &block) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/validation_annotations/form_builder.rb', line 38 def check_boxes(method, , &block) = (method, ) [:class].push("checkboxes") if [:class].is_a?(Array) @template.content_tag(:div, , &block) end |
#password_field(method, options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/validation_annotations/form_builder.rb', line 16 def password_field(method, = {}) = (method, ) super(method, ) end |
#radio_buttons(method, options, &block) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/validation_annotations/form_builder.rb', line 31 def (method, , &block) = (method, ) [:class].push("radio") if [:class].is_a?(Array) @template.content_tag(:div, , &block) end |
#text_area(method, options = {}) ⇒ Object
21 22 23 24 |
# File 'lib/validation_annotations/form_builder.rb', line 21 def text_area(method, = {}) = (method, ) super(method, ) end |
#text_field(method, options = {}) ⇒ Object
26 27 28 29 |
# File 'lib/validation_annotations/form_builder.rb', line 26 def text_field(method, = {}) = (method, ) super(method, ) end |