class ParsleySimpleForm::Constraints::Basics::MinConstraint

Public Instance Methods

html_attributes() click to toggle source
# File lib/parsley_simple_form/constraints/basics/min_constraint.rb, line 15
def html_attributes
  attributes = {:'data-parsley-min-message' => I18n::translate('form_validation.message.min', min: @min)}
  attributes.merge({:type => 'number', :min => @min}) if (@input_html[:min].nil? || !mapped_type == 'number')
end
match?() click to toggle source
# File lib/parsley_simple_form/constraints/basics/min_constraint.rb, line 7
def match?
  return false if @options.nil?
  @min = @options[:min]

  @input_html = @options[:input_html]
  !@options[:min].nil? || (!@input_html[:min].nil? && mapped_type == 'number')
end