-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Unable to use asset_path
#284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey, did you followed this guide - https://github.com/rails/webpacker/blob/master/README.md#linking-to-sprockets-assets in README? |
Is there no way this can't just be included already as it is in a typical |
@mgwidmann At the moment no, it's in the Wishlist though 👍 |
Documented the options in README - https://github.com/rails/webpacker#link-sprocket-assets |
@gauravtiwari that specific part of the README seems to have been removed for some reason. |
@lbrito1 It's here now: https://github.com/rails/webpacker/blob/master/docs/assets.md under docs/ folder |
TLDR; use |
in your your_file_name.js.erb file
|
Not sure if this belongs here, but since this is part of the
rails new --webpack
output, I figure I'd at least make this project aware.Copied from usabilityhub/rails-erb-loader#33
With a
js.erb
file of the following contents:I have got this to work with my own rake task separately, heres the code for doing that. The trick is being able to add include Rails.application.routes.url_helpers, which most templating engines do not make very easy (Erubis is terrible as you can see below):
The text was updated successfully, but these errors were encountered: