Skip to content

Instantly share code, notes, and snippets.

@coryodaniel
Created August 18, 2016 13:49
Show Gist options
  • Select an option

  • Save coryodaniel/429485cc49417fe695fa3aafa3f497ab to your computer and use it in GitHub Desktop.

Select an option

Save coryodaniel/429485cc49417fe695fa3aafa3f497ab to your computer and use it in GitHub Desktop.
UUID Regex for Rails router constraint
resource :foos, constraints: {:id => /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/}
resource :bars, constraints: {:id => /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(,[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment