In Rails 3 routing, it seems we're using the match() method to hook up
arbitrary url patterns to rack endpoints (which I think is a great new
routing feature).
I'd like to suggest that we name it "connect", instead of "match":
1. It maintains continuity with previous versions of rails
2. It's more descriptive of the intention of a route: to connect a
requested url with an endpoint that can generate a response.
I'm oppose to this though. In my point of view, I think the name `match` is already appropriate for it, as it mean that the router will try 'match' the incoming request with each route, and sent the one that 'matched' to the appropriate controller.
I’m oppose to this though. In my point of view, I think the name match is already appropriate for it, as it mean that the router will try ‘match’ the incoming request with each route, and sent the one that ‘matched’ to the appropriate controller.
It maintains continuity with previous versions of rails
You MUST rewrite your routes anyway, so what a problem? Is it too hard to learn just 1 word?
It’s more descriptive of the intention of a route: to connect a
requested url with an endpoint that can generate a response.
As opposite, there are rules that must be “matched”.
>> 1. It maintains continuity with previous versions of rails
You MUST rewrite your routes anyway, so what a problem? Is it too hard to learn just 1 word?
I said criticism is ok, not personal attacks. Of course it's not too
hard to learn. My point is that it's a change from every previous
version of Rails that seems unnecesary to me. If it is not necessary,
then it should not be done.
>> It's more descriptive of the intention of a route: to connect a
>> requested url with an endpoint that can generate a response.
As opposite, there are rules that must be "matched".
That's been true since Rails 0.x. I think "connect" has been the
right choice ever since, and I'm not seeing why we need to rename it
to match().
My hope is that either someone on the core team will agree that it
should remain as connect, or that someone from the core team will
explain why a change is necessary. I'll be happy if either of those
happen, because I will have learned something.
I'm certainly not an expert, but I think this syntax was carried over from Merb's router. It's distinctly different in that you can specify a route in "chunks"; for example, see the last example of this tutorial: