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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:00:51+00:00 2026-06-13T17:00:51+00:00

I installed gmaps4rails in my application. The view related stuff seems to be working,

  • 0

I installed gmaps4rails in my application.

The view related stuff seems to be working, since the an empty google maps shows up. So I am thinking that I installed it correctly.

I followed the quick start on the github page:

My controller:

def map
    @businesses = Business.all
    @json = @businesses.to_gmaps4rails

    respond_to do |format|
      format.html
      format.json {render json:@businesses}
    end
  end

My view:

=gmaps4rails(@json)
=@json

I print @json and realized that the value is empty i.e. []

My business.rb model:

class Business < ActiveRecord::Base
  belongs_to :city
  belongs_to :category
  has_many :reviews

  attr_accessible :address, :description, :name, :phone, :urbanization, :url, :city_id

  include FriendlyId
  friendly_id :name, :use => :slugged

  acts_as_gmappable

  def gmaps4rails_address
    # "#{self.address}, #{self.urbanization}, #{self.city.name}"
    "619 Johnson Street, Kingston, ON"
  end
end

I hard coded the address for testing…

  • 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-13T17:00:52+00:00Added an answer on June 13, 2026 at 5:00 pm

    Gmaps4rails doesn’t geocode on the fly for performance concerns.

    to_gmaps4rails returns empty json if objects don’t have lat or long.

    You should preprocess your objects (simply save them).

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

Sidebar

Related Questions

I have installed the sweet Google-Maps-for-Rails plugin, which seems to be under active development.
Installed a fresh Delphi xe2. Open a new project (vcl forms application). opened the
Installed Magento 1.6.2.0, and noticed that the links are like http://MYSEUPERSTORE.com/ index.php /customer/account/ but
Installed Google App Engine 1.2.5 and Web Toolkit 1.7.1 . However I still get
Installed latest SDK updates from Google and my project changed to target 2.1 I
I installed Google Chrome Portable on the user's desktop and have the default homepage
I installed MonoDevelop and want to use its design view editor. After a bit
Installed Thinking Sphinx via Gemfile: gem 'thinking-sphinx',:git => 'git://github.com/freelancing-god/thinking-sphinx.git' When I run rake thinking_sphinx:configure
I installed Python through MacPorts, and then changed the path to that one. /opt/local/bin/python
i installed https://play.google.com/store/apps/details?id=com.ivona.tts and all their voices. How can i programmatically get list of

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.