Home>

I am making a system like airbnb with ruby.
You've even gotten to the point where you can see the features of Google Maps.
Also, it has been confirmed that a search function can be added on the same page to pin the search result to the correct address.

[Added model]

geocoded_by :address
after_validation :geocode, if: :address_changed?

In the above, after saving with address, it is replaced with latitude and history.

It is designed to register an address when registering a property,
It has been confirmed in the DB that the address was saved correctly at the registration stage.

When calling with html, it is called below.

var location = {lat:<%= @camera.latitude %>, lng:<%= @camera.longitude %>};

What I tried

There are no errors, and the address is saved even if you look at the DB, so
I thought if there was any clue, I asked a question.

If i have any advice for resolving the error, we would appreciate it.