Search code examples
javascriptruby-on-rails-4gmaps4railsrails-geocoder

Gmaps4rails not displaying markers with latitude and longitude


I have seen previous questions regarding this issue but they are not recent have not been answered (please correct me if I am wrong)...

Anyways here is the issue I have been having with Gmaps4rails gem. The latitude and longitude are recorded (using geocoder gem) but they will not display on the gmaps4rails map. The map displays fine on the show page but there are no markers.

provider.rb - model

enter image description here

show.html.haml enter image description here

providers_controller.rb - controller enter image description here

latitude and longitude recorded in active admin enter image description here

Can someone please point me in the right direction? Thanks!


Solution

  • Wow I feel stupid. Copied and pasted my index action code into the show action and everything worked perfectly

    Copied and pasted this into the show action.

    @providers = Provider.all
    @markers = ...