Guest User

Untitled

a guest
May 27th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. I'm trying to add a marker with an info_window on my map in a rjs request using a partial.
  2.  
  3. ---- new.js.rjs ----
  4. marker = GMarker.new([@bar.lat, @bar.lng], :info_window => render(:partial => "/foo/bar", :object => @bar))
  5. page << @map.record_global_init(marker.declare('new_bar')) # declare js variable
  6. page << @map.overlay_init(marker)
  7. page << @map.record_init("new_bar.openInfoWindowHtml(\"#{marker.info_window}\");\n")
  8. ----end new.js.rjs ----
  9.  
  10. ----_bar.html.erb----
  11. hello
  12. ----end _bar.html.erb----
  13.  
  14. The above works fine. However if I add a new line or other html to my partial the marker and info_window do not appear.
  15.  
  16. ----_bar.html.erb----
  17. hello
  18.  
  19. there
  20. ----end _bar.html.erb----
Add Comment
Please, Sign In to add comment