Re: [openstreetmap/openstreetmap-website] XML generation: nodes, ways, relations, map controller → view (#2223)

mmd notifications at github.com
Thu Jul 4 14:18:33 UTC 2019


mmd-osm commented on this pull request.



> @@ -0,0 +1,8 @@
+xml.instruct!
+
+xml.osm(OSM::API.new.xml_root_attributes) do |osm|
+  osm << (render(:partial => "bounds", :object => @bounds) || "")
+  osm << (render(@nodes) || "")
+  osm << (render(@ways) || "")
+  osm << (render(@relations) || "")

Documentation https://guides.rubyonrails.org/layouts_and_rendering.html says:

> In the event that the collection is empty, render will return nil, so it should be fairly simple to provide alternative content.
> 
> ```
> <h1>Products</h1><%= render(@products) || "There are no products available." %>
> ```






-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2223#discussion_r300419078
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190704/5bb24156/attachment.html>


More information about the rails-dev mailing list