Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6843261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:13:26+00:00 2026-05-27T00:13:26+00:00

I have a show page that should show a business and a google map

  • 0

I have a show page that should show a business and a google map of the business. I use google maps API v3. I have required //= require gmaps4rails/googlemaps.js in application31.js and added the following line into the model (business.rb):

  acts_as_gmappable

  def gmaps4rails_address
    "#{self.address}, #{self.city.name}, #{self.state.name}" 
  end

Stylesheets are also required (included). I also included gem ‘gmaps4rails’ into Gemfile and bundled. My model has latitude and longitude with correct values in the database.

In my business_controller.rb I have added

def show
  ...
  @json = Business.find(params[:id]).to_gmaps4rails
  ...
end

And on business show page I have added

%div
  = gmaps4rails(@json)

Footer contains

%footer
  = yield :scripts

Now the frame of google maps appears but it’s empty. Here are the relevant lines concerning the error:

<footer>
225 <script type="text/javascript" src="//maps.google.com/maps/api/js?v=3.5&sensor=false&amp;libraries=geometry"></script>
226 <script type="text/javascript" src="//google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/src/infobox_packed.js"></script>
227 <script type="text/javascript" src="//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.5/src/markerclusterer_packed.js"></script>
228 <script type="text/javascript" src="//google-maps-utility-library-v3.googlecode.com/svn/trunk/richmarker/src/richmarker-compiled.js"></script>
229
230 <script type="text/javascript" charset="utf-8">
231
232 Gmaps.map = new Gmaps4RailsGoogle();
233 Gmaps.load_map = function() {
234 Gmaps.map.map_options.auto_adjust = true;
235 Gmaps.map.initialize();
236 Gmaps.map.markers = [{"lng": "77.225", "lat": "28.6353"}];
237 Gmaps.map.markers_conf.do_clustering = true;
238 Gmaps.map.create_markers();
239 Gmaps.map.adjustMapToBounds();
240 Gmaps.map.callback();
241 };
242 window.onload = function() { Gmaps.loadMaps(); };

The errors now is:

 Gmaps is not defined" for line 232

Does anyone know what it can be? I also have installed geocoder, but I hope this can not create any issue.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:13:27+00:00Added an answer on May 27, 2026 at 12:13 am

    As per my comment, rename application31.js to application.js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image icon in an HTML page that should show right to
I have a web page that should insert new DB records and show them
I have a page which should show a form with checkboxes, post back if
I have a page where I show businesses that are within a certain number
I have a Thread model which has a show page, and in that action's
I have result page from DB, on each row I have show/hide button that
I have a jquery mobile page that contains a button that when tapped should
I have some divs in the page that show different things of the same
I am developing a page in which i have to show video with its
I have a WebView. I'd like to show some page from my server, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.