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

mmd notifications at github.com
Wed Jun 26 20:16:14 UTC 2019


> Check out #2278 since it applies to many of the partial renderings that you have in this PR.

Not 100% sure, if my understanding is right, so let's try `/map/index.xml.builder`:

```
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) || "")
end
```

Triggers:

`API threw unexpected ActionView::Template::Error exception: Missing partial api/nodes/_node with {:locale=>[:en], :formats=>[:xml], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :jsonify, :coffee]}. `

I believe this kind of optimization doesn't work due to the way I'm keeping all node, way and relation partials under the umbrella of the /map call.

#2278 works in that other pull request, as all partials are located in the directory named after the model, so the direct lookup is possible. Somehow I'm working against that convention in my coding...

I think he only way to make this work would be to move /api/map/_{node,way,relation}.xml.builder to /api/{nodes,ways,relations} respectively.



-- 
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#issuecomment-506028295
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190626/7be10e38/attachment.html>


More information about the rails-dev mailing list