>From the ActionMailer documentation:
"URLs can be generated in mailer views using url_for or named routes. Unlike
controllers from Action Pack, the mailer instance doesn’t have any context
about the incoming request, so you’ll need to provide all of the details
needed to generate a URL."
Have you tried this?
config.action_mailer.default_url_options{:host => "foo.com/bar"}
On Thu, Feb 17, 2011 at 3:32 PM, Gabe Hollombe <[email protected]> wrote:
> Hey all,
>
> I've got a Rails 3 app. Let's say I'm deploying it to http://foo.com/bar.
> In a mailer, I want to use sign_in_url (sign_in is a named route) to get a
> url like http://foo.com/bar/sign_in. Alas, in the context of my mailer,
> Rails has no idea about the fact that this app is deployed to a
> subdirectory. So, what's the right way to get the proper url with the
> deployed subdirectory, from the named route url helper? I thought
> setting ENV['RAILS_RELATIVE_URL_ROOT'] = '/bar' would work, but it
> doesn't seem to get looked at when my mailer is generating the url with the
> named route helper.
>
> Any thoughts? I'm sure I'm missing something obvious here, but I clearly
> don't know what it is.
>
> -g
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
>
--
Stuart Coyle
stuart dot coyle at gmail dot com
--
You received this message because you are subscribed to the Google Groups "Ruby
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.