Class: Bureaucrat::Fields::SlugField

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

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



688
689
690
# File 'lib/bureaucrat/fields.rb', line 688

def default_error_messages
  super.merge(invalid: "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.")
end

#default_validatorsObject



692
693
694
# File 'lib/bureaucrat/fields.rb', line 692

def default_validators
  [Validators::ValidateSlug]
end