Class: Bureaucrat::Fields::IPAddressField

Inherits:
CharField show all
Defined in:
lib/bureaucrat/fields.rb

Overview

MultiValueField FilePathField SplitDateTimeField

Instance Attribute Summary

Attributes inherited from CharField

#max_length, #min_length

Attributes inherited from Field

#error_messages, #help_text, #hidden_widget, #initial, #label, #required, #show_hidden_initial, #validators, #widget

Instance Method Summary collapse

Methods inherited from CharField

#initialize, #to_object, #widget_attrs

Methods inherited from Field

#bound_data, #clean, #default_hidden_widget, #default_widget, #initialize, #initialize_copy, #populate_object, #prepare_value, #run_validators, #to_object, #validate, #widget_attrs

Constructor Details

This class inherits a constructor from Bureaucrat::Fields::CharField

Instance Method Details

#default_error_messagesObject



678
679
680
# File 'lib/bureaucrat/fields.rb', line 678

def default_error_messages
  super.merge(invalid: 'Enter a valid IPv4 address.')
end

#default_validatorsObject



682
683
684
# File 'lib/bureaucrat/fields.rb', line 682

def default_validators
  [Validators::ValidateIPV4Address]
end