diff --git a/app/decorators/work_decorator.rb b/app/decorators/work_decorator.rb index acb4d5655..d8f175709 100644 --- a/app/decorators/work_decorator.rb +++ b/app/decorators/work_decorator.rb @@ -38,22 +38,12 @@ def wizard_mode? def file_list_path return work_file_list_path("NONE") if @work.nil? || !@work.persisted? - # This is a horrible hack to work-around the issue where Rails is not adding - # the correct prefix to the URL in production and staging. - if Rails.env.production? || Rails.env.staging? - "/describe" + work_file_list_path(@work.id) - else - work_file_list_path(@work.id) - end + work_file_list_path(@work.id) end def download_path return if @work.nil? || !@work.persisted? - if Rails.env.production? || Rails.env.staging? - "/describe" + work_download_path(@work.id) - else - work_download_path(@work.id) - end + work_download_path(@work.id) end end diff --git a/config/environments/production.rb b/config/environments/production.rb index 05e17f6c0..29533b900 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -133,3 +133,5 @@ ORCID_URL = "https://pub.orcid.org/v2.0" ROR_URL = "https://api.ror.org/organizations" + +Rails.application.routes.default_url_options[:relative_url_root] = "/describe" diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 94afe28ba..623150c3c 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -134,3 +134,5 @@ ORCID_URL = "https://pub.orcid.org/v2.0" ROR_URL = "https://api.ror.org/organizations" + +Rails.application.routes.default_url_options[:relative_url_root] = "/describe"