On 5-jun-2006, at 20:36, Nicholas Seckar wrote:


On Jun 5, 2006, at 1:47 PM, Julian 'Julik' Tarkhanov wrote:

Are you certain about that? I for one expect the opposite - that it would be an "absolute" URL. However I understand where it's headed (for instance your apps would love to preserve the subdomain when sending mails). Will investigate.

I think it's reasonable to require all the parameters be present for AM url_for's... but we still need to access some request vars, such as request.host for obvious reasons.

Ok, I think I'll tackle it the following way.

1. specifically for ActionMailer
ActionMailer::Base.current_relative_controller = current_controller (as a before_filter for the ActionController::Base)
        and forward the url_for directly to the instance of it
        Seems like a proper fit for Railties as a mixin for AM.

2. for all the other cases that might need the infrastructure
ActionController::Routing::Routes.default_request_parameters = {:host => 'bla'}
        and retrieve it through something like
        ActionController::Routing::Routes.default_url_for(*params)

Wat do you think?
--
Julian 'Julik' Tarkhanov
please send all personal mail to
me at julik.nl


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

Reply via email to