class ActionView::Helpers::InstanceTag

Public Instance Methods

to_check_box_tag_with_html5_attributes(options = {}, checked_value = "1", unchecked_value = "0") click to toggle source
# File lib/html5_validators/action_view/form_helpers_rails3.rb, line 49
def to_check_box_tag_with_html5_attributes(options = {}, checked_value = "1", unchecked_value = "0")
  if object.is_a?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false)
    options["required"] ||= object.attribute_required?(method_name)
  end
  to_check_box_tag_without_html5_attributes options, checked_value, unchecked_value
end
to_input_field_tag_with_html5_attributes(field_type, options = {}) click to toggle source
# File lib/html5_validators/action_view/form_helpers_rails3.rb, line 19
def to_input_field_tag_with_html5_attributes(field_type, options = {})
  if object.is_a?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false)
    options["required"] ||= object.attribute_required?(method_name)
    options["maxlength"] ||= object.attribute_maxlength(method_name)
    options["minlength"] ||= object.attribute_minlength(method_name)
    options["max"] ||= object.attribute_max(method_name)
    options["min"] ||= object.attribute_min(method_name)
  end
  to_input_field_tag_without_html5_attributes field_type, options
end
to_radio_button_tag_with_html5_attributes(tag_value, options = {}) click to toggle source
# File lib/html5_validators/action_view/form_helpers_rails3.rb, line 41
def to_radio_button_tag_with_html5_attributes(tag_value, options = {})
  if object.is_a?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false)
    options["required"] ||= object.attribute_required?(method_name)
  end
  to_radio_button_tag_without_html5_attributes tag_value, options
end
to_text_area_tag_with_html5_attributes(options = {}) click to toggle source
# File lib/html5_validators/action_view/form_helpers_rails3.rb, line 31
def to_text_area_tag_with_html5_attributes(options = {})
  if object.is_a?(ActiveModel::Validations) && (object.auto_html5_validation != false) && (object.class.auto_html5_validation != false)
    options["required"] ||= object.attribute_required?(method_name)
    options["maxlength"] ||= object.attribute_maxlength(method_name)
    options["minlength"] ||= object.attribute_minlength(method_name)
  end
  to_text_area_tag_without_html5_attributes options
end