Merge pull request #13165 from chahmedejaz/bugfix/unable-to-view-images-in-dev-env

Fix base urls for assets in development
This commit is contained in:
Konrad
2025-02-20 07:56:09 +01:00
committed by GitHub
4 changed files with 5 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ OFN_REDIS_URL="redis://localhost:6379/1"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2" OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
OFN_REDIS_CABLE_URL="redis://localhost:6379/0" OFN_REDIS_CABLE_URL="redis://localhost:6379/0"
SITE_URL="0.0.0.0:3000" SITE_URL="localhost:3000"
# Deactivate rack-timeout in development. # Deactivate rack-timeout in development.
# https://github.com/zombocom/rack-timeout#configuring # https://github.com/zombocom/rack-timeout#configuring

View File

@@ -18,6 +18,7 @@ class ApplicationMailer < ActionMailer::Base
def roadie_options def roadie_options
# This lets us specify assets using relative paths in email templates # This lets us specify assets using relative paths in email templates
super.merge(url_options: { host: URI(main_app.root_url).host }) url = URI(main_app.root_url)
super.merge(url_options: { host: url.host, port: url.port })
end end
end end

View File

@@ -16,7 +16,7 @@
%table{:bgcolor => "#f2f2f2"} %table{:bgcolor => "#f2f2f2"}
%tr %tr
%td %td
%img{src: ContentConfig.url_for(:footer_logo), width: "144", height: "50"}/ = image_tag ContentConfig.url_for(:footer_logo), width: "144", height: "50"
%td{:align => "right"} %td{:align => "right"}
%h6.collapse %h6.collapse
= Spree::Config[:site_name] = Spree::Config[:site_name]

View File

@@ -69,8 +69,7 @@ Openfoodnetwork::Application.configure do
# Show emails using Letter Opener # Show emails using Letter Opener
config.action_mailer.delivery_method = :letter_opener config.action_mailer.delivery_method = :letter_opener
config.action_mailer.default_url_options = { host: "0.0.0.0:3000" } config.action_mailer.default_url_options = { host: "localhost:3000" }
config.action_mailer.asset_host = "http://localhost:3000"
config.log_level = ENV.fetch("DEV_LOG_LEVEL", :debug) config.log_level = ENV.fetch("DEV_LOG_LEVEL", :debug)
end end