Skip to content

Commit facee3c

Browse files
Fix alt asset path (#2)
* Allow for assets being compiled into a non-default location (re: @drborges)
1 parent e43aabb commit facee3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/react/server_rendering/yaml_manifest_container.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ module ServerRendering
66
# but sometimes, they're compiled to other directories (or other servers)
77
class YamlManifestContainer
88
def initialize
9-
@assets = YAML.load_file(::Rails.root.join("public/assets/manifest.yml"))
9+
@assets = YAML.load_file(::Rails.root.join("public", ::Rails.application.config.assets.prefix, "manifest.yml"))
1010
end
1111

1212
def find_asset(logical_path)
1313
asset_path = @assets[logical_path] || raise("No compiled asset for #{logical_path}, was it precompiled?")
14-
asset_full_path = ::Rails.root.join("public", "assets", asset_path)
14+
asset_full_path = ::Rails.root.join("public", ::Rails.application.config.assets.prefix, asset_path)
1515
File.read(asset_full_path)
1616
end
1717

0 commit comments

Comments
 (0)