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

Reply via email to