lib/gmaps4rails/helper/gmaps4rails_helper.rb
# This method returns whether the gmaps api scripts should **always** be included in the 
# html head rather than in a body script tag on demand. 
#
# By default, the api should be included in the header if the application uses turbolinks.
# But the behaviour can be overridden by setting it explicitly, for example in an
# initilizer:
#
#    # config/initializers/gmaps4rails.rb
#    YourAppName::Application.config.gmaps4rails = { include_api_in_header: true }
#
This method returns whether the gmaps api scripts should **always** be included in the
html head rather than in a body script tag on demand.

By default, the api should be included in the header if the application uses turbolinks.
But the behaviour can be overridden by setting it explicitly, for example in an
initilizer.


This method returns whether the gmaps api scripts should ** always ** be included in the html head rather than in a body script tag on demand . By default the api should be included in the header if the application uses turbolinks . But the behaviour can be overridden by setting it explicitly for example in an initilizer .
def include_gmaps4rails_api_in_header?
    if defined?(Rails.configuration.gmaps4rails) && Rails.configuration.gmaps4rails[:include_api_in_header]
      Rails.configuration.gmaps4rails[:include_api_in_header]
    else
      defined? Turbolinks
    end
  end
def include_gmaps4rails_api_in_header? if defined? ( Rails . configuration . gmaps4rails ) && Rails . configuration . gmaps4rails [ :include_api_in_header ] Rails . configuration . gmaps4rails [ :include_api_in_header ] else defined? Turbolinks end end
This method returns whether the gmaps api scripts should **always** be included in the
html head rather than in a body script tag on demand.
This method returns whether the gmaps api scripts should ** always ** be included in the html head rather than in a body script tag on demand .