On Jan 15, 2008, at 7:38 AM, Max Ischenko wrote:
1. Mapper.connect('foobar') looks both simpler and more explicit than RouteMap.foobar. Why this "magic"?
I guess that isn't needed, it was my suggestion but I think Chris AtLee has some good points about this as well. The thing is, its really Mapper.connect('name', 'foobar',....) and the name moves if you don't supply it. We could require the name in Routes 2, that would solve that problem at least.
2. url_for -object certainly ain't simpler or more explicit either. Again, I don't see how url_for().foobar is better then url_for("foobar").
What if you want a relative URL to foobar? url_for.foobar(**extra_args) definitely seems a little nicer to me.
3. "Unnamed routes will no longer be allowed". I remember Ben saying this will never happen.
You'll be able to do a single 'default' route. That can be used by unnamed routes, since you'll know which route its going to use at least.
The unpredictability in Routes was caused by URL generation minimization, and the way it hunted through routes depending on the args. There was just no way to make a predictable scheme that was comprehendible by the users, so using named routes is the only real solution. Apparently they've realized this in Rails as well, and they recommend extensive use of named routes.
Cheers, Ben
smime.p7s
Description: S/MIME cryptographic signature