]> git.openstreetmap.org Git - rails.git/commitdiff
Simplify partial rendering
authormmd-osm <mmd.osm@gmail.com>
Wed, 26 Jun 2019 20:29:18 +0000 (22:29 +0200)
committermmd-osm <mmd.osm@gmail.com>
Wed, 26 Jun 2019 20:29:18 +0000 (22:29 +0200)
22 files changed:
app/views/api/map/index.xml.builder
app/views/api/nodes/_node.xml.builder [moved from app/views/api/map/_node.xml.builder with 100% similarity]
app/views/api/nodes/index.xml.builder
app/views/api/nodes/show.xml.builder
app/views/api/old_nodes/history.xml.builder
app/views/api/old_nodes/version.xml.builder
app/views/api/old_relations/history.xml.builder
app/views/api/old_relations/version.xml.builder
app/views/api/old_ways/history.xml.builder
app/views/api/old_ways/version.xml.builder
app/views/api/relations/_relation.xml.builder [moved from app/views/api/map/_relation.xml.builder with 100% similarity]
app/views/api/relations/full.xml.builder
app/views/api/relations/index.xml.builder
app/views/api/relations/relations_for_node.xml.builder
app/views/api/relations/relations_for_relation.xml.builder
app/views/api/relations/relations_for_way.xml.builder
app/views/api/relations/show.xml.builder
app/views/api/ways/_way.xml.builder [moved from app/views/api/map/_way.xml.builder with 100% similarity]
app/views/api/ways/full.xml.builder
app/views/api/ways/index.xml.builder
app/views/api/ways/show.xml.builder
app/views/api/ways/ways_for_node.xml.builder

index 841ea8384d73f145ff10f9f416d78e6301271a73..d7fb7e7fc637045630a42ccf474dae4481596808 100644 (file)
@@ -2,7 +2,7 @@ xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
   osm << (render(:partial => "bounds", :object => @bounds) || "")
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
   osm << (render(:partial => "bounds", :object => @bounds) || "")
-  osm << (render(:partial => "node", :collection => @nodes) || "")
-  osm << (render(:partial => "way", :collection => @ways) || "")
-  osm << (render(:partial => "relation", :collection => @relations) || "")
+  osm << (render(@nodes) || "")
+  osm << (render(@ways) || "")
+  osm << (render(@relations) || "")
 end
 end
index 5c73c219365ea2cd8bafe2a8b52ecc0d65552ef8..1968de97a73ac8bb80354866beaaa19c631f5a3f 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/node", :collection => @nodes) || "")
+  osm << (render(@nodes) || "")
 end
 end
index 5c73c219365ea2cd8bafe2a8b52ecc0d65552ef8..1968de97a73ac8bb80354866beaaa19c631f5a3f 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/node", :collection => @nodes) || "")
+  osm << (render(@nodes) || "")
 end
 end
index fd07025dfa0924e8c9a89ddf6fd92026d8f113e7..905381ce9020020a35daabcf01c3a6cc09fa9130 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "old_node", :collection => @elems) || "")
+  osm << (render(@elems) || "")
 end
 end
index fd07025dfa0924e8c9a89ddf6fd92026d8f113e7..905381ce9020020a35daabcf01c3a6cc09fa9130 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "old_node", :collection => @elems) || "")
+  osm << (render(@elems) || "")
 end
 end
index 7e01b24905e91fb81219ab7e14cc702c5c702569..905381ce9020020a35daabcf01c3a6cc09fa9130 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "old_relation", :collection => @elems) || "")
+  osm << (render(@elems) || "")
 end
 end
index 7e01b24905e91fb81219ab7e14cc702c5c702569..905381ce9020020a35daabcf01c3a6cc09fa9130 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "old_relation", :collection => @elems) || "")
+  osm << (render(@elems) || "")
 end
 end
index c04d745778935e593ea15882020707eef02a3d7d..905381ce9020020a35daabcf01c3a6cc09fa9130 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "old_way", :collection => @elems) || "")
+  osm << (render(@elems) || "")
 end
 end
index c04d745778935e593ea15882020707eef02a3d7d..905381ce9020020a35daabcf01c3a6cc09fa9130 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "old_way", :collection => @elems) || "")
+  osm << (render(@elems) || "")
 end
 end
index e7e6c92bccff84b126236048f64e169f212a65a1..e23061727c4c1d2756d5a5a3e4cd08836a3ea71e 100644 (file)
@@ -1,7 +1,7 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/node", :collection => @nodes) || "")
-  osm << (render(:partial => "api/map/way", :collection => @ways) || "")
-  osm << (render(:partial => "api/map/relation", :collection => @relations) || "")
+  osm << (render(@nodes) || "")
+  osm << (render(@ways) || "")
+  osm << (render(@relations) || "")
 end
 end
index a753e8ea887f2f4395b64bd475b21acb900800a2..f39a20bb937a3fd9c5ece31fcd024a83c7b22a6d 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/relation", :collection => @relations) || "")
+  osm << (render(@relations) || "")
 end
 end
index a753e8ea887f2f4395b64bd475b21acb900800a2..f39a20bb937a3fd9c5ece31fcd024a83c7b22a6d 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/relation", :collection => @relations) || "")
+  osm << (render(@relations) || "")
 end
 end
index a753e8ea887f2f4395b64bd475b21acb900800a2..f39a20bb937a3fd9c5ece31fcd024a83c7b22a6d 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/relation", :collection => @relations) || "")
+  osm << (render(@relations) || "")
 end
 end
index a753e8ea887f2f4395b64bd475b21acb900800a2..f39a20bb937a3fd9c5ece31fcd024a83c7b22a6d 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/relation", :collection => @relations) || "")
+  osm << (render(@relations) || "")
 end
 end
index a753e8ea887f2f4395b64bd475b21acb900800a2..f39a20bb937a3fd9c5ece31fcd024a83c7b22a6d 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/relation", :collection => @relations) || "")
+  osm << (render(@relations) || "")
 end
 end
index 93ca2c0874d81e50e237d2cb1606480f69689c6c..d8b3aea803b6217bae2e665361ae72ef03873d52 100644 (file)
@@ -1,6 +1,6 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/node", :collection => @nodes) || "")
-  osm << (render(:partial => "api/map/way", :collection => @ways) || "")
+  osm << (render(@nodes) || "")
+  osm << (render(@ways) || "")
 end
 end
index 33818c68f5133e1cdf810b819f2e9a806f7b5a03..bcb89cdc6c4050e113e97845ca8a5676e45325d5 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/way", :collection => @ways) || "")
+  osm << (render(@ways) || "")
 end
 end
index 33818c68f5133e1cdf810b819f2e9a806f7b5a03..bcb89cdc6c4050e113e97845ca8a5676e45325d5 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/way", :collection => @ways) || "")
+  osm << (render(@ways) || "")
 end
 end
index 33818c68f5133e1cdf810b819f2e9a806f7b5a03..bcb89cdc6c4050e113e97845ca8a5676e45325d5 100644 (file)
@@ -1,5 +1,5 @@
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
 xml.instruct!
 
 xml.osm(OSM::API.new.xml_root_attributes) do |osm|
-  osm << (render(:partial => "api/map/way", :collection => @ways) || "")
+  osm << (render(@ways) || "")
 end
 end