Skip to content

Commit 278ebab

Browse files
author
Rafael Mendonça França
committed
Merge pull request #87 from swisener/master
Respect Rails.public_path when computing the path to the manifest file. Conflicts: lib/sprockets/railtie.rb test/test_railtie.rb
2 parents b06c0bf + f565058 commit 278ebab

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/sprockets/railtie.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def configure(&block)
6565
config.after_initialize do |app|
6666
config = app.config
6767

68-
manifest_path = config.assets.manifest || File.join(app.root, 'public', config.assets.prefix)
68+
manifest_path = config.assets.manifest || File.join(config.paths['public'].first, config.assets.prefix)
6969

7070
# Configuration options that should invalidate
7171
# the Sprockets cache when changed.

test/test_railtie.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,13 @@ def test_manifest_path
185185

186186
assert_match %r{config/foo/manifest-.*.json}, ActionView::Base.assets_manifest.path
187187
end
188+
189+
def test_manifest_path_respects_rails_public_path
190+
app.configure do
191+
config.paths['public'] = 'test_public'
192+
end
193+
app.initialize!
194+
195+
assert_match %r{test_public/assets/manifest-.*.json}, ActionView::Base.assets_manifest.path
196+
end
188197
end

0 commit comments

Comments
 (0)