I will use the GMAP3 Plugin for JQuery in my rails app.
I already put the javascript file in app/assets/javascripts/gmap3/gmap3.min.js
.
I will use this jQuery plugin only on the welcome page. What files do I need to modify (and how) in order to make use the plugin?
You should put the file ( for a Rails 3 project ) in vendor/assets/javascripts/gmap3.min.js
and then you should add it in two ways:
<%= javascript_include_tag 'gmap3.min' %>
or in some added file like
//In (for example) application.js
//= require gmap3.min
If you added the file correctly, that is, in a page that you are seeing (you can check this in your browser console, usually in Resources
or Network
), you can use it.
Some links for you to see:
http://railsapps.github.io/rails-javascript-include-external.html
http://railscasts.com/episodes/279-understanding-the-asset-pipeline?view=asciicast
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