Access to global Rails configuration within components #375
-
I decided to open this up as a question instead of an issue because I am unsure if it is expected and wanted behavior, or if it is a bug. TLDR: Should asset helpers for webpack assets be able to access important/relevant global Rails configuration (i.e. Setup
Experience
Code in question: (same code for both the controller view as well as the component
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
This is due to the isolation of ViewComponent context. However, <%= image_tag(helpers.asset_pack_path("media/images/some_image.png")) %> should work correctly. See this test (and associated component) for confirmation of this functionality: https://github.com/github/view_component/blob/master/test/view_component/view_component_test.rb#L272 |
Beta Was this translation helpful? Give feedback.
-
@mellowfish So, testing out this |
Beta Was this translation helpful? Give feedback.
-
Resolved in https://github.com/github/view_component/releases/tag/v2.11.0 by @tbroad-ramsey. |
Beta Was this translation helpful? Give feedback.
Resolved in https://github.com/github/view_component/releases/tag/v2.11.0 by @tbroad-ramsey.