code_corps v0.0.1 CodeCorps.Validators.SlugValidator View Source
Used for validating slug fields in a given changeset.
Link to this section Summary
Functions
Validates a slug
Link to this section Functions
Validates a slug.
Matches slugs with:
- only letters
- prefixed/suffixed underscores
- prefixed/suffixed numbers
- single inside dashes
- single/multiple inside underscores
- one character
Prevents slugs with:
- prefixed symbols
- prefixed/suffixed dashes
- multiple consecutive dashes
- single/multiple/multiple consecutive slashes
Also prevents slugs that conflict with reserved routes for either the API or the web.