I am trying to call my new/create form in an infowindow in google maps (gmaps4rails)
My current code is :
def index
@locations = Location.all
@hash = Gmaps4rails.build_markers(@locations) do |location, marker|
marker.lat location.latitude
marker.lng location.longitude
#marker.infowindow location.title
marker.infowindow render new_data
end
end
The first problem that I have is that I don't know how to render a path from a different view. Meaning, this controller is a locations controller and I am trying to render a data form based on this route
new_data GET /data/new(.:format) datas#new
I tried to check rendering with the location's form, but than I am getting that @location is nil. I know that this will be the next problem I will encounter once I figure out the rendering, so I will appreciate inputs on this one as well.