Ivan
Ivan

Reputation: 103879

relative_url_root in ActionMailer

What's the equivalent of relative_url_root in ActionMailer?

I've tried setting it up in default_url_options, but it appends the parameter in the query string.

Adding :skip_relative_url_root = false doesn't work either.

Using :host = 'somehost.com/subdir' does work, but is that appropriate?

Thanks!

Upvotes: 5

Views: 741

Answers (2)

Steve x slapps.fr
Steve x slapps.fr

Reputation: 1244

A cleaner way to do it :

config.action_mailer.default_url_options = {
        :host => "somehost.com",
        :only_path => false,
        :script_name => "/subdir"
    }

Source

Upvotes: 3

Mark Huk
Mark Huk

Reputation: 2380

Use script_name option into default_url_options of ActionMailer::Base. Based on this article.

Upvotes: 1

Related Questions