Commit 846ef72b authored by Stan Hu's avatar Stan Hu

Fix CSS loading errors in e-mail notifications

https://gitlab.com/gitlab-org/gitlab/merge_requests/17699 introduced a
new CSS file that was not rendered properly in production mode since
`Rails.configuration.assets.compile` is disabled and the search path was
not correct.

To fix this, we use `Rails.root.join` instead of `File.join`. The latter
provides a relative path that is not found by the Rails search path.

Closes https://gitlab.com/gitlab-org/gitlab/issues/36201
parent e0e66d87
......@@ -329,7 +329,7 @@ module ApplicationHelper
if Rails.configuration.assets.compile
app.assets.find_asset(name).to_s
else
controller.view_context.render(file: File.join('public/assets', app.assets_manifest.assets[name]))
controller.view_context.render(file: Rails.root.join('public/assets', app.assets_manifest.assets[name]).to_s)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment