I am trying to get gmaps4rails with Active Admin in Rails Rails 3.2.8.
I have been trying to follow this tutorial but have needed to adapt it as I am using mysql in my stack.
I am not getting any errors (which might help!) but I am also not getting any maps.
My model (location) has the attributes longitude:float, langitude:float and gmaps:boolean
I have added the following to the locations model, which is different to the tutorial:
def location
[:latitude, :longitude]
end
and this to the active admin locations model, also different from the tutorial:
f.input :location do |o|
gmaps("markers" => {data: o.to_gmaps4rails}, "map_options" => { auto_zoom: false, zoom: 15 })
end
As far as I can tell (by scanning through the rendered source files) the CSS and JavaScript seem to be loading.
The whole app is available here
Other that those changes, I think I have stuck to the tutorial.
I was just working on the same problem and seem to have come up with a solution. If you create a new partial and call it in your active admin model like
form :partial = 'partial_name'Then in the partial using the
You will still need to include the gmaps4rails sprockets in your active admin css and js files.