Class: ActionView::Helpers::InstanceTag
- Inherits:
-
Object
- Object
- ActionView::Helpers::InstanceTag
- Defined in:
- lib/html5_validators/action_view/form_helpers_rails3.rb
Instance Method Summary collapse
- #to_check_box_tag_with_html5_attributes(options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
- #to_input_field_tag_with_html5_attributes(field_type, options = {}) ⇒ Object
- #to_radio_button_tag_with_html5_attributes(tag_value, options = {}) ⇒ Object
- #to_text_area_tag_with_html5_attributes(options = {}) ⇒ Object
Instance Method Details
#to_check_box_tag_with_html5_attributes(options = {}, checked_value = "1", unchecked_value = "0") ⇒ Object
49 50 51 52 53 54 |
# File 'lib/html5_validators/action_view/form_helpers_rails3.rb', line 49 def to_check_box_tag_with_html5_attributes( = {}, checked_value = "1", unchecked_value = "0") if object.class.ancestors.include?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false) ["required"] ||= object.attribute_required?(method_name) end to_check_box_tag_without_html5_attributes , checked_value, unchecked_value end |
#to_input_field_tag_with_html5_attributes(field_type, options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/html5_validators/action_view/form_helpers_rails3.rb', line 19 def to_input_field_tag_with_html5_attributes(field_type, = {}) if object.class.ancestors.include?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false) ["required"] ||= object.attribute_required?(method_name) ["maxlength"] ||= object.attribute_maxlength(method_name) ["minlength"] ||= object.attribute_minlength(method_name) ["max"] ||= object.attribute_max(method_name) ["min"] ||= object.attribute_min(method_name) end to_input_field_tag_without_html5_attributes field_type, end |
#to_radio_button_tag_with_html5_attributes(tag_value, options = {}) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/html5_validators/action_view/form_helpers_rails3.rb', line 41 def (tag_value, = {}) if object.class.ancestors.include?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false) ["required"] ||= object.attribute_required?(method_name) end tag_value, end |
#to_text_area_tag_with_html5_attributes(options = {}) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/html5_validators/action_view/form_helpers_rails3.rb', line 31 def to_text_area_tag_with_html5_attributes( = {}) if object.class.ancestors.include?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false) ["required"] ||= object.attribute_required?(method_name) ["maxlength"] ||= object.attribute_maxlength(method_name) ["minlength"] ||= object.attribute_minlength(method_name) end to_text_area_tag_without_html5_attributes end |