abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: Route matching too liberal?
Date Fri, 08 Feb 2008 04:21:12 GMT
Ruby matching can span segments if a default value for the missing 
variables is provided.  We, however, don't have default values for our 
variables.  It would make sense for us to tighten up the matching rules.

- James

Jim Ancona wrote:
> I have run into some problems with my Routes matching unexpectedly. 
> Before filing a bug, I thought I'd ask for feedback on whether the 
> current behavior is correct.
> The current algorithm attempts to match the non-variable parts of the 
> pattern, setting the variable to whatever is in between.
> So the pattern "/base/:collection/" matches both "/base/test/" and 
> "/base/test/123/". In the second case, the value of the collection 
> variable is "test/123". In my opinion, not allowing matches to span URI 
> segments would be less prone to unintuitive results.
> FWIW, a quick glance at some docs on Ruby Routes seems to indicate that 
> they do not span URI path segments.
> Thoughts?
> Jim

View raw message