diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-02 16:49:02 -0500 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-06-03 23:32:12 +1000 |
commit | 08baa343c884767e6b6536365893042ba1fc14e5 (patch) | |
tree | f690558ed895cc4e202bbe6fefd8eb3cc29aacff /actionmailer/lib/action_mailer | |
parent | e57dbfe6af368cca9f4c827eb70937086cbf7ed7 (diff) | |
download | rails-08baa343c884767e6b6536365893042ba1fc14e5.tar.gz rails-08baa343c884767e6b6536365893042ba1fc14e5.tar.bz2 rails-08baa343c884767e6b6536365893042ba1fc14e5.zip |
Extract assets paths and make them available to Action Mailer as well
Diffstat (limited to 'actionmailer/lib/action_mailer')
-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| |