Rails 4 - how to reference a javascript source in vendor file -
i have discovered need amend gmaps rails setup inserting javascript files directly in app. rails 4 - gmaps4rails - map won't render
i have cloned both infobox , markerclusterer repos , stuck in trying reference relevant files in app.
i have folders of files came clone in vendor file.
i understand javascript files need use are: infobox.js , markerclusterer.js
these files located in:
vendor/js-marker-clusterer/src/makerclusterer.js vendor/v3-utility-library/src/infobox.js
i want use them in place of code in view:
<script src="//maps.google.com/maps/api/js?v=3.18&sensor=false&client=&key=&libraries=geometry&language=&hl=®ion="></script> <script src="//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js"></script> <script src='//google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/src/infobox_packed.js' type='text/javascript'></script> <!-- if need custom infoboxes -->
do need reference javascript files in app/application.js? if so, @ point in path need start (given these files not inside vendor/assets/javascripts folder)?
also, understand need incorporate markerclusterer images somehow. have come through in cloned repo , stored in vendor/js-markerclusterer/images folder. how reference these work in view?
the logical thing place folders js-marker-clusterer
, v3-utility-library
under vendor/assets/javascripts
can reference files need in application.js
as
//= js-marker-clusterer/src/makerclusterer //= v3-utility-library/src/infobox
if, however, cannot reason can add custom path config.assets.paths
autoloader can find them
// application.rb config.assets.paths << rails.root.join("vendor", "js-marker-clusterer") config.assets.paths << rails.root.join("vendor", "v3-utility-library")
and reference them as
//= src/makerclusterer //= src/infobox