On Jun 5, 2006, at 10:32 AM, Julian 'Julik' Tarkhanov wrote:

On the subject of http://dev.rubyonrails.org/ticket/1138

As we are now revamping the routing, maybe it might be sensible to create a decoupled url_for that only depends on the Routes and bails if no routes have been defined? I'd say the inability to use url_for in the Mailer is more of an annoying coupling problem than a roadblock. There should be a way to generate URLs without a controller.

I agree. However, when people use a Mailer within the context of a request, they typically expect url_for to operate like it does in a view--that is, to reuse request parameters. That's where the dependency on the controller comes in--the url rewriter needs a request instance to operate.

If a clean way can be devised to allow it to work as expected in both environments (request vs. cron, for example), I'd certainly consider it.

As you said, it is not a roadblock, merely a coupling problem. Please do investigate how to decouple these.

- Jamis

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to