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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:37:27+00:00 2026-06-03T14:37:27+00:00

Im trying to use geocoder for displaying a location based on an address. My

  • 0

Im trying to use geocoder for displaying a location based on an address.

My question is, what do I put in the view to show an interactive map once I got the Lat and Long from the address the user inserted in the database?

my address model

 belongs_to <another model>
 attr_accessible <all addresses attributes including latitude and longitude>

 geocoded_by :address

 after_validation :geocode, :if => :address_changed?

The fields Latitude and Longitude are automatically calculated after I insert the address.

I’ve followed Ryan’s Rail Cast tutorial but at the end, instead of displaying a static image I want to display a map, google maps interactive style. How can I achieve this?

If’ve taken a look at Google-Maps-for-Rails but couldn’t understand how very well like how to get a single map on location in the show view.

  • 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-03T14:37:28+00:00Added an answer on June 3, 2026 at 2:37 pm

    Take a closer look at Google-Maps-for-Rails. That gem makes it trivial, and the instructions on how to get the interactive map in your view are quite clear:

    (I’ll presume your Address model belongs_to a User model. Change names as appropriate.)

    If you just want the one specific user on the map, of course you could change the controller:

    @json = User.find(params[:id]).address.to_gmaps4rails
    

    In your view:

    <%= gmaps4rails(@json) %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the geocoder to get co-ordinates for the following address: 1945
I'm trying to use the Google Maps geocoder with Python and JSON, but keep
I'm a little confused here, I am trying use a partial view in a
I'm trying to use Google geocoder service to get the coordinates of cities input
I'm trying to use the Google Geocoder API to get me a Latitude and
i have been trying to use some ajax to save venue location in my
I am trying to use the google geocoder api to get the longitude and
I am trying to use the MKReverseGeoCoder API to get a city name based
I'm trying to use yahoo placefinder on my website to find people's location, but
I am getting a physical location address from a user and trying to arrange

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.