In mulitple views I am including an external javascript library with this HTML:
<script type="text/javascript"
src="http://static.jstree.com/v.1.0pre/jquery.jstree.js">
</script>
In reading through the Rails 3.1 Asset Pipeline documentation and discussions I get the impression that vendor/assets/javascripts
is a place were that file should be referenced. I'm guessing that I could download a copy of the file (jstree.js
) and place it in that directory. However I'd like to have it loaded off the project site instead of making a local copy of it.
What do I put in vendor/assets/javascripts to pull a copy of jstree.js off the remote server? Do I create a .js file with some sort of remote load code? There seems to be all sorts of approaches and/or confusion on how to best do this ( see the long list of answers to this question: How do I include a JavaScript file in another JavaScript file? .)
Is there a "Rails Standard" convention/library/process for doing this? I'm a javascript neophyte, so please be explicit, thanks.