diff --git a/lib/thredded_create_app/tasks/add_roadie.rb b/lib/thredded_create_app/tasks/add_roadie.rb
index da443db..9d12415 100644
--- a/lib/thredded_create_app/tasks/add_roadie.rb
+++ b/lib/thredded_create_app/tasks/add_roadie.rb
@@ -27,13 +27,21 @@ def after_bundle
before: /\nend\n\z$/,
content: indent(2, "\n" + roadie_production_config)
replace 'app/views/layouts/mailer.html.erb',
- %r{}m,
- "<%= stylesheet_link_tag 'email' %>"
+ %r{ *\n}m,
+ indent(4, mailer_template_head)
git_commit 'Add Roadie configuration'
end
private
+ def mailer_template_head
+ <<~'ERB'
+ <%# Ensure the stylesheet is referenced without a host so that the local
+ version is read by Roadie even if asset_host is set. %>
+
+ ERB
+ end
+
def roadie_development_config
<<~'RUBY'
# Set the default URL options for both Roadie and ActionMailer:
@@ -46,9 +54,6 @@ def roadie_development_config
def roadie_production_config
<<~'RUBY'
- # Roadie requires that action_mailer.asset_host is nil, see:
- # https://github.com/Mange/roadie-rails/blob/9e3cb2ed59f4ec9fda252ad016b23e106983a440/README.md#known-issues
- config.action_mailer.asset_host = nil
# Set the default URL options for both Roadie and ActionMailer:
config.roadie.url_options = config.action_mailer.default_url_options = {
host: ENV['APP_HOST'] || '[SET ME] myapp.herokuapp.com',