From 223f3a61e93b16d710ce77fe83169bc44b51cb81 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Fri, 19 Sep 2014 11:00:36 +0900 Subject: [PATCH] Compact map_marker.js and use Utils.jsonify. --- app/views/shared/_map_marker.html.erb | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/app/views/shared/_map_marker.html.erb b/app/views/shared/_map_marker.html.erb index 7d02b3be..7db4b459 100644 --- a/app/views/shared/_map_marker.html.erb +++ b/app/views/shared/_map_marker.html.erb @@ -1,13 +1,7 @@ <%- unless @map_marker_included_p -%> - <%- content_for :head do -%> - <%= javascript_include_tag "map_marker" %> - <%- end -%> - <%- @map_marker_included_p = true -%> +<%- content_for :head do -%> +<%= javascript_include_tag "map_marker" %> <%- end -%> - map_marker(<%= map %>, { - lat: <%= location[:lat].to_json %>, - lng: <%= location[:lng].to_json %>, - radius: <%= location[:radius].to_json %>, - course: <%= location[:course].to_json %>, - speed: <%= location[:speed].to_json %> - }); +<%- @map_marker_included_p = true -%> +<%- end -%> +map_marker(<%= map %>, <%= Utils.jsonify(location) %>)