0

I am building an app for renting rooms. I am using active admin and the geocoder gem. Now to my issue: I want to update the address of a room in the active admin panel which works perfectly but it will not update the longitude and latitude columns autoamtically for me... and I have no idea why? How can I make this work?

I have permited the params in (room.rb - activeadmin)

permit_params :longitude, :latitude

I am using also an after_validation in (room.rb - model)

geocoded_by :address
after_validation :geocode, if: :address_changed?
trickydiddy
  • 577
  • 6
  • 26
  • 1
    The `latitude` and `longitude` entered in your active_admin form are not being used if the `address` is changed. What do you have in `address` and is `address` one of the permit_params? – SteveTurczyn Oct 24 '16 at 12:05
  • Yes address was also in the permit params it seems that the issue is only on one record... I recreated the room and it works without any issue still thank you! ;) – trickydiddy Oct 24 '16 at 12:08

1 Answers1

0

I have no idea why but the issue appears only on one record(room). I have created the room one more time and it works like a charm!

trickydiddy
  • 577
  • 6
  • 26