I have a Rails app with about 20 pages, and only two of them use Google Maps.
Is there a better way to exclusively load the Google Maps API - script on certain pages than this (in the head tag):
<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false" if params[:controller] == "shops" && params[:action] == "index" %>
source share