Is there any chance to display a precompiled javascript file? A simple file has no problems with:
def iframe_communication
render file: "/app/assets/javascripts/iframe_communication_module.js"
end
I tried assets_pathor included it in javascript_include_tagthe view, but failed.
For clarification, I do not want to add a script to my view. I am trying to display a javascript file for external access (tagging <script>from other domains).
Refresh
render file: "..." shows file as expected but not compiled versionassets_path "/app/assets/javascripts/iframe_communication_module.js"returns "/app/assets/javascripts/iframe_communication_module.js", not the path to the compiled resourcejavascript_include_tag loads the script as expected (no rendering)
The Rails 4 resource pipeline compiles everything into a single file, is there any chance of getting one file from it?
Or is this the best way to compile it manually?
2
this: assets_path , . :
asset_path "application.js"
asset_path "application", type: :javascript