This successfully builds a working bikebike rails app with Docker!

Former-commit-id: 0a55db70c4049243d5eb6c164698c93f49b1746a
This commit is contained in:
2021-12-22 22:45:37 -05:00
parent df5cce9efa
commit 9fe8c70ea6
13 changed files with 199 additions and 25 deletions
+4
View File
@@ -0,0 +1,4 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .scss
//= link_directory ../fonts
+4 -4
View File
@@ -5,8 +5,8 @@ module I18nHelper
url ||= current_path(true)
return url if Rails.env.development? || Rails.env.test?
return "https://preview-#{locale.to_s}.bikebike.org#{url}" if Rails.env.preview?
"https://#{locale.to_s}.bikebike.org#{url}"
return "https://preview-#{locale.to_s}." + ENV['DEFAULT_URL'] + "#{url}" if Rails.env.preview?
"https://#{locale.to_s}." + ENV['DEFAULT_URL'] + "#{url}"
end
def current_path(relative = false)
@@ -21,13 +21,13 @@ module I18nHelper
return url_for(new_params) if relative
subdomain = Rails.env.preview? ? "preview-#{locale.to_s}" : locale.to_s
url_for(new_params.merge(host: "#{subdomain}.bikebike.org"))
url_for(new_params.merge(host: "#{subdomain}." + ENV['DEFAULT_URL']))
end
def canonical_url
url = current_path
return url if Rails.env.development? || Rails.env.test?
return "https://preview.bikebike.org#{url}" if Rails.env.preview?
return ENV['DEFAULT_URL'] + "#{url}" if Rails.env.preview?
"https://bikebike.org#{url}"
end
+3 -3
View File
@@ -6,7 +6,7 @@ class UserMailer < ActionMailer::Base
before_filter :set_host
default from: "Bike!Bike! <info@bikebike.org>"
default from: "Bike!Bike! <" + ENV['SMTP_USER_NAME'] + ">"
def email_confirmation(confirmation)
@confirmation = EmailConfirmation.find_by_id(confirmation) if confirmation.present?
@@ -172,9 +172,9 @@ class UserMailer < ActionMailer::Base
private
def set_host(*args)
if Rails.env.production?
@host = "https://#{I18n.locale.to_s}.bikebike.org"
@host = "https://#{I18n.locale.to_s}." + ENV['DEFAULT_URL']
elsif Rails.env.preview?
@host = "https://preview-#{I18n.locale.to_s}.bikebike.org"
@host = "https://preview-#{I18n.locale.to_s}." + ENV['DEFAULT_URL']
else
@host = UserMailer.default_url_options[:host]
end