From 71ea2b048574439ade827a4cc5054b0d3d5fd10d Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Sat, 31 Aug 2013 16:07:27 +0100 Subject: [PATCH] Remove "\/" from escaped JavaScript to prevent test errors. We were getting annoying "couldn't close

with " messages when running tests, because escape_javascript was turning

into <\/p>. We fixed this by gsub'ing \/ to / after calling escape_javascript. What could possibly go wrong? :-) --- app/views/places/show.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/places/show.html.haml b/app/views/places/show.html.haml index feb523391..4a52bb829 100644 --- a/app/views/places/show.html.haml +++ b/app/views/places/show.html.haml @@ -14,10 +14,10 @@ - Member.located.each do |m| - popup = render :partial => 'members/popover', :locals => { :member => m } - - popup.gsub!(/\n/, "") # Linebreaks in strings break JavaScript + - popup = escape_javascript(popup).gsub(/\\\//, "/") :javascript marker = new L.Marker(new L.LatLng(#{m.latitude}, #{m.longitude})); - marker.bindPopup('

#{link_to m, m}

#{ escape_javascript(popup) }').openPopup(); + marker.bindPopup('

#{link_to m, m}

#{ popup }').openPopup(); map.addLayer(marker); %h3