I am having an issue with the asset pipeline, I already have a resource / controller called assets. So i have changed assets.prefix option to "/externals".
config.assets.prefix = '/externals'
This simple dose not work unless i remove:
resources: assets
Then all works as expected.
I am not sure how to write a test to prove this but i have created a app to showcase it.
https://github.com/nodrog/asset-pipeline-issue
If you run the app, and visit '/products' all will work, then go to the routes file and change the variable create_bug to true.
We have looked into https://github.com/rails/rails/blob/master/actionpack/lib/sprockets/helpers/rails_helper.rb, and then added a debugger to the asset_path method.
This method is not called, if you but a debugger in the javascript_include_tag method. And run method(:asset_path).source_location, it tells you it is calling the method from default routes not from the sprockets helper.
Any help would be greatly appreciated...
UPDATE:
I reported this to the rails people, and they fixed it. The fix is now in the master branch.
https://github.com/rails/rails/issues/3643#issuecomment-2775938
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