From facee3cefa8f11c3ae45bba4bd645809e0b76f02 Mon Sep 17 00:00:00 2001 From: Wade Winningham Date: Thu, 1 Sep 2016 15:50:52 -0500 Subject: [PATCH] Fix alt asset path (#2) * Allow for assets being compiled into a non-default location (re: @drborges) --- lib/react/server_rendering/yaml_manifest_container.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/react/server_rendering/yaml_manifest_container.rb b/lib/react/server_rendering/yaml_manifest_container.rb index fbda791e6..a8da5cf85 100644 --- a/lib/react/server_rendering/yaml_manifest_container.rb +++ b/lib/react/server_rendering/yaml_manifest_container.rb @@ -6,12 +6,12 @@ module ServerRendering # but sometimes, they're compiled to other directories (or other servers) class YamlManifestContainer def initialize - @assets = YAML.load_file(::Rails.root.join("public/assets/manifest.yml")) + @assets = YAML.load_file(::Rails.root.join("public", ::Rails.application.config.assets.prefix, "manifest.yml")) end def find_asset(logical_path) asset_path = @assets[logical_path] || raise("No compiled asset for #{logical_path}, was it precompiled?") - asset_full_path = ::Rails.root.join("public", "assets", asset_path) + asset_full_path = ::Rails.root.join("public", ::Rails.application.config.assets.prefix, asset_path) File.read(asset_full_path) end