diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-02 16:49:02 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-02 16:49:02 -0500 |
commit | 631dc618853325e5780237388224cb785a3a1b82 (patch) | |
tree | f690558ed895cc4e202bbe6fefd8eb3cc29aacff /actionmailer | |
parent | 942fe6514cc0db10c04fd2b46f8e1537beabef71 (diff) | |
download | rails-631dc618853325e5780237388224cb785a3a1b82.tar.gz rails-631dc618853325e5780237388224cb785a3a1b82.tar.bz2 rails-631dc618853325e5780237388224cb785a3a1b82.zip |
Extract assets paths and make them available to Action Mailer as well
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 1 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/railtie.rb | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 3c41691af7..3a82979d35 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -311,6 +311,7 @@ module ActionMailer #:nodoc: include AbstractController::Layouts include AbstractController::Helpers include AbstractController::Translation + include AbstractController::AssetPaths helper ActionMailer::MailHelper diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb index 0730167a3e..43a4936013 100644 --- a/actionmailer/lib/action_mailer/railtie.rb +++ b/actionmailer/lib/action_mailer/railtie.rb @@ -13,7 +13,16 @@ module ActionMailer end initializer "action_mailer.set_configs" do |app| + paths = app.config.paths + am = app.config.action_mailer + + am.assets_dir ||= paths.public.to_a.first + am.javascripts_dir ||= paths.public.javascripts.to_a.first + am.stylesheets_dir ||= paths.public.stylesheets.to_a.first + ActiveSupport.on_load(:action_mailer) do + self.config.merge!(am) + include app.routes.url_helpers app.config.action_mailer.each do |k,v| |