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

  • Home
  • SEARCH
  • 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 8017931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:59:09+00:00 2026-06-04T20:59:09+00:00

With the Geocoder gem , using the advanced geocoding section I can’t seem to

  • 0

With the Geocoder gem, using the advanced geocoding section I can’t seem to get it to work. I basically took every Address Component Type on the Google Maps Documentation and put it inside of the Geocoder::Result block:

geocoded_by :street_address  do |obj,results|
 if geo = results.first
  obj.route = geo.route
  obj.intersection = geo.intersection
  obj.political = geo.political
  obj.country = geo.country
  obj.administrative_area_level_1 = geo.administrative_area_level_1
  obj.administrative_area_level_2 = geo.administrative_area_level_2
  obj.administrative_area_level_3 = geo.administrative_area_level_3
  obj.colloquial_area = geo.colloquial_area
  obj.floor = geo.floor
  obj.room = geo.room
 end
end
after_validation :reverse_geocode

But I get this error:

NoMethodError in StoresController#create

undefined method `route' for #<Geocoder::Result::Google:0x6939150>

If I remove it this object it just goes to the next one, such as intersection.

What is the issue here?

  • 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-04T20:59:10+00:00Added an answer on June 4, 2026 at 8:59 pm

    From the API documentation http://rdoc.info/github/alexreisner/geocoder/master/Geocoder/Result/Google

     - (Object) address_components_of_type(type)
    
    Get address components of a given type. Valid types are defined in Google's Geocoding API documentation and include (among others):
    
    :street_number
    :locality
    :neighborhood
    :route
    :postal_code
    

    So for the route example you need to call geo.address_components_of_type(:route)

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

Sidebar

Related Questions

I'm using this gem called Geocoder that's part of Ruby on rails. You can
I am using geocoder and the devise gem. And i am trying to get
I'm using the geocoder gem which has the ability to pick up IP address
Using the Google Geocoder v3, if I try to geocode 20 addresses, I get
I'm trying to use the geocoder to get co-ordinates for the following address: 1945
I am trying to get location address from Geocoder, I am able to get
I'm using Google's Geocoder to find lat lng coordinates for a given address. var
I need to reverse geocode two locations from and to. Using the geocoder gem
I am using the gem 'geocoder'. I am trying to make an object that
Can the Geocoder class provide reverse lookups outside of the United States? I basically

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.