Skip to content

Instantly share code, notes, and snippets.

@joshuaclayton
Created October 22, 2008 19:21
Show Gist options
  • Save joshuaclayton/18759 to your computer and use it in GitHub Desktop.
Save joshuaclayton/18759 to your computer and use it in GitHub Desktop.
# This could be used to generate a list of first-order URLs that should be unavailable
# to a model if you're going to follow the routing convention of site.com/:slug
# Obviously, if you namespace the site, you're going to want to modify the index of 'segments'
ActionController::Routing::Routes.routes.map {|c| c.segments[1].value if c.segments[1]}.compact.uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment