You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I don't know. My "workaround" works fine, just wanted to discuss this issue. I can make a PR that updates with_assets helper to do something more reasonable. Opinions, thougts?
The text was updated successfully, but these errors were encountered:
Oh totally open to more work on this. I added the with_assets code years ago and just left it there, so I'm sure we can make it cooler. The full path makes a lot of sense to me. This could be standard in 5.0 (which will be based on Trailblazer::Cell).
Let's say I have two concepts: payment and article, both have compex forms which I want to make as cells. Structure is this:
Now guess what - I can't require both form.js files using approach proposed in guides. I would do:
What I am doing next is adding both form.js fies to my application.js, right? So it would look like:
And, after doing some tests, I see that sprockets would just pick first form.js, ignoring the other. What can I do about it? Well:
Come up with uniq names for asset fies
This would work fine, except that it looks stupid :-)
Use full path to assets
Idea, at least as it seems to be, is to filestructure without any weird prefixes and just include assets by using full path:
The only this is that due to the way cells-rails adds paths to assets path this won't work.
What I ended up doing is to add this line to application.rb:
Now in my application.js I can easily do:
So, I don't know. My "workaround" works fine, just wanted to discuss this issue. I can make a PR that updates with_assets helper to do something more reasonable. Opinions, thougts?
The text was updated successfully, but these errors were encountered: