Politics, Programming and Possibilities
30 Aug
I updated the routing system to Merb again yesterday. I’ve added plenty of specs and examples now to illustrate its flexibility and usefulness. What I used to call “late-bound routes” is now “deferred routes” which makes more sense.
Take a look at the new specs for a run-through.
6 Responses for "Another Major Change to Merb Routes"
Sweet stuff!
Are you sure line 44 of the pastie (http://pastie.textmate.org/92610) is right? It looks like the title regex should yield to [0] in the match, no?
It’s index base is 1 (since ‘0′ is the whole string when dealing with a MatchData object), so it’s correct. I would normally be more skeptical of myself, but the specs say it’s correct too
[...] Note: The API has significantly changed since this posting. Best to check out this post for details. [...]
Thanks for posting this Duane. I’m new to Merb (and only a little more seasoned in Rails) so I could be totally wrong, but would line #13 ever match since it is just a more specific version of #11?
The matching tries to be exact, so no, #11 would not match if there is another “/” in the URL followed by an id.
Good to know. Thanks Duane.
Leave a reply