Forum: Ruby on Rails runner: url_for with mailers impossible

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joe (Guest)
on 2006-02-16 23:10
I created a runner script to send a newsletter. I found this hack where
you pass a controller and specify a helper:

http://wiki.rubyonrails.org/rails/pages/HowtoUseUr...

But in a runner script there is no controller to pass. So, it looks like
it's impossible to use url_for in the mailer template this way.

Another way around the no url_for problem is to pass the generated url
to the mailer, but again there is no controller in runner scripts.

Impossible?

Joe
Ben B. (Guest)
on 2006-03-30 01:27
Joe (or anyone else),

Did you ever find a solution to this problem? Thanks.

Ben

Joe wrote:
> I created a runner script to send a newsletter. I found this hack where
> you pass a controller and specify a helper:
>
> http://wiki.rubyonrails.org/rails/pages/HowtoUseUr...
>
> But in a runner script there is no controller to pass. So, it looks like
> it's impossible to use url_for in the mailer template this way.
>
> Another way around the no url_for problem is to pass the generated url
> to the mailer, but again there is no controller in runner scripts.
>
> Impossible?
>
> Joe
This topic is locked and can not be replied to.