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 8059605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:43:30+00:00 2026-06-05T09:43:30+00:00

This has proven a difficult thing to Google. I know it seems like it

  • 0

This has proven a difficult thing to Google. I know it seems like it should be easy to Google.

I’m trying to understand how to implement nice libraries like gmaps.js.

application.html.erb:

<%= javascript_include_tag :defaults %>
<%= javascript_include_tag "gmaps" %>

Not sure if both of those are necessary. I have gmaps.js in my /vendor/assets/javascripts folder, using rails 3.2.3. I would love to know if the former handles it.

app/assets/javascripts/indexmap.js:

new GMaps({
    div: '#map',
    lat: -12.043333,
    lng: -77.028333
});

index.html.erb:

<div id="themap">
    <%= javascript_include_tag("indexmap") %>
</div>

application.css:

#themap{
  display: block;
  width: 95%;
  height: 350px;
  margin: 0 auto;
  -moz-box-shadow: 0px 5px 20px #ccc;
  -webkit-box-shadow: 0px 5px 20px #ccc;
  box-shadow: 0px 5px 20px #ccc;
}

All I get is a blank box.

  • 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-06-05T09:43:31+00:00Added an answer on June 5, 2026 at 9:43 am

    try “:gmaps” instead of “gmaps”.

    Also, try right-click inspect on the box, and see if JS is throwing an error in Chrome’s inspector.

    OK- update, figured it out.

    You need to use Google Maps and JQuery to get this to work. There is no CSS per se, you need to establish the object in a jQuery document ready block. I’ve zipped a sample of this working (in a basic rails app).

    Essentially, include jQuery and Maps above the gMaps.js, and then include some JS:

    <server type="text/javascript">
    $(document).ready(function(){
      map = new GMaps({
        div: '#map',
        lat: -12.043333,
        lng: -77.028333
      });
    });
    </script>
    <div id="map" style="height:200px;width:200px;"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like a simple question, but has proven to be difficult to find
I know very little about regex so this has proven very challenging for me.
This one has proven to be a little tricky for me so far. I
I'm attempting to install PyLucene 3.0.3 on Ubuntu 10.04. This has proven considerably challenging,
I've tried to do some research on lidgren but it has proven very difficult
I have some legacy product data that has proven difficult to work with. The
This has been a rather problematic issue on numerous occasions. We have alot of
This has to be a frequent question, but not on SO yet, so it
This has happened before to me, but I can't remember how I fixed it.
This has been driving me crazy for the past few minutes I have a

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.