drubio1989/Kickball — pull request #1 by HeroicEric (2014-03-02 16:02:39+00:00)
Title: Namespace Routes

You’re running into an issue where your route for the position page is
never being used.

The routes are really just a bunch of regular expressions that are used
to take the URL that you visit and determine which code to run.

Since both of your routes were looking for “/“ + anything, going to the
URL `/1st_Base` was still matching the route for a team. Sinatra can’t
tell whether the stuff after `/` is a team name or a position name, and
it takes the first match that it finds.

If you provide a namespace, like shown in this commit, you shouldn’t
have that problem and the code that you already wrote works.

Now you will visit URLs like:

- `/teams/Jetson_Jets`
- `/positions/1st_Base`