class ParsleySimpleForm::Constraints::Basics::TypeConstraint

Public Instance Methods

html_attributes() click to toggle source
# File lib/parsley_simple_form/constraints/basics/type_constraint.rb, line 11
def html_attributes
  attributes = {"data-parsley-type-#{mapped_type}-message".to_sym => I18n::translate("form_validation.message.#{mapped_type}")}
  attributes.merge!({"data-parsley-type" => mapped_type}) unless HTML_NATIVE_TYPES.include?(mapped_type)
  attributes
end
match?() click to toggle source
# File lib/parsley_simple_form/constraints/basics/type_constraint.rb, line 7
def match?
  TYPES_CONSTRAINTS.include?(type) or !TYPE_MAP[type].nil?
end