Calling link_to from rake task

I have a rake task, which informs users about all kind of statuses in the application by e-mail.

It would be nice if I could create active links together with statuses. But have noticed that link_to helper is not available for rake or ActionMailer. Is there an easy way to include link_to helper in rake or example below is the only sane way of doing it :frowning:

body << '<a href="http://my.site.com/link&quot;&gt;Link&lt;/a&gt;&#39;

by TheR

Use a template. All the usual view helpers will be available there. You’ll also want to make sure you set default_url_options:

otherwise all your links will be missing the host part.

–Matt Jones