Suggestion to rename match() to connect()

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.

Feedback?

Thanks!
Jeff

Anybody have thoughts on this one? (Criticism is ok if I'm off my
rocker.)

Jeff

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.

Not core team I am, so let's see how other thinks :slight_smile:

-- Prem S.

Absolutely agree with you.

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.

  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?

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.

Jeff

This is not personal attack. Well, s/You/Developer -- that's exactly what I mean. Peace :slight_smile:

Ah, thanks for the clarification. Peace :slight_smile:

Jeff

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:

http://merbunity.com/tutorials/12

Note that the Merb syntax wasn't 100% retained (.to has become :to, and the block argument has vanished), but it's much closer.

--Matt Jones