javascript - Gmap4rails: infowindow render action from different controller -
javascript - Gmap4rails: infowindow render action from different controller -
i have home.html.erb file displaying markers. markers correspond new sport created user. when marker clicked want display sport info (along other values). in main controller have associated show partial markers , pass required locales.
@hash = gmaps4rails.build_markers(@game) |game, marker| marker.lat game.latitude marker.lng game.longitude marker.infowindow render_to_string(:partial => 'games/show', :layout => false, :locals => { :@game => @game }) end end
in _show.html.erb file, trying display sport, associated game.
<div class="row"> <aside class="span4"> <section> <p> <strong>sport:</strong> <%= @game.sport %> </p> </section> </aside> </div>
i getting next error. undefined method `sport' #.
how can display parameters in @game in infowindow.
regards hari
javascript ruby-on-rails google-maps
Comments
Post a Comment