I would like to include some js files that are not in the asset pipeline, i tried to include with rails.root and the full path to those files but that is not working cause of permissions.
I know i can manually include every single JS file in my asset pipeline JS application.js but that would be a lot of work since my JS change a lot during development, so it would be nice if there was a way to include a js file outside asset pipeline.
Anyone has some suggestions on how I could approach this?
You can put the file in the old pre-3.1 location /public/javascripts
and link to it manually.
If you don't want your assets to be processed by Sprockets, put them into the public folder (not public/assets
, that's where the compiled assets are) and then you can access them as static resources, i.e. don't reference them with the javascript_include_tag
helper method, but the good old HTML way.
For example I have an OpenLayers.js file that doesn't work well with the assets pipeline, so I add it to the public/javascripts
folder and then in the header of my layout I link to it like that:
<script src="/javascripts/OpenLayers.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With