Avoid using @variables in partials
authormmd-osm <mmd.osm@gmail.com>
Wed, 26 Jun 2019 19:34:40 +0000 (21:34 +0200)
committermmd-osm <mmd.osm@gmail.com>
Wed, 26 Jun 2019 19:34:40 +0000 (21:34 +0200)
app/views/api/map/_bounds.xml.builder
app/views/api/map/index.xml.builder

index 85cca01f90a27cc06c94e2b8b7c25d73b0616b1c..8a38e21ea8cf16ee52d5a9f8a6d01cda503b431e 100644 (file)
@@ -1,8 +1,8 @@
 attrs = {
-  "minlat" => format("%.7f", @bounds.min_lat),
-  "minlon" => format("%.7f", @bounds.min_lon),
-  "maxlat" => format("%.7f", @bounds.max_lat),
-  "maxlon" => format("%.7f", @bounds.max_lon)
+  "minlat" => format("%.7f", bounds.min_lat),
+  "minlon" => format("%.7f", bounds.min_lon),
+  "maxlat" => format("%.7f", bounds.max_lat),
+  "maxlon" => format("%.7f", bounds.max_lon)
 }
 
 xml.bounds(attrs)
index bd70f20bdcbeb53c3816eca1254c867d4a069618..841ea8384d73f145ff10f9f416d78e6301271a73 100644 (file)
@@ -1,7 +1,7 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "bounds") || "")
+  osm << (render(:partial => "bounds", :object => @bounds) || "")
   osm << (render(:partial => "node", :collection => @nodes) || "")
   osm << (render(:partial => "way", :collection => @ways) || "")
   osm << (render(:partial => "relation", :collection => @relations) || "")