<p>As the issue title suggests, this is still very much WIP with the intention to gather some early feedback, go through a number of iterations to fix issues, etc.</p>
<p>Topic in this PR:</p>
<p>Move the XML generation from the controller to the view for the following controllers:</p>
<ul>
<li>nodes_controller</li>
<li>ways_controller</li>
<li>relations_controller</li>
<li>old_controller</li>
<li>map_controller</li>
</ul>
<p>TODO:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Remove XML generation methods in models</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Add "redaction" flag in XML response, check if anything else if missing</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> A good approach to keep using changeset_cache, user_display_name_cache</li>
</ul>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/2223'>https://github.com/openstreetmap/openstreetmap-website/pull/2223</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Move xml gen. into view for (old) nodes, ways, relations, map</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-0">app/controllers/api/map_controller.rb</a>
    (24)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-1">app/controllers/api/nodes_controller.rb</a>
    (16)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-2">app/controllers/api/old_controller.rb</a>
    (19)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-3">app/controllers/api/relations_controller.rb</a>
    (49)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-4">app/controllers/api/ways_controller.rb</a>
    (42)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-5">app/views/api/map/_bounds.xml.builder</a>
    (8)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-6">app/views/api/map/_node.xml.builder</a>
    (24)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-7">app/views/api/map/_relation.xml.builder</a>
    (19)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-8">app/views/api/map/_way.xml.builder</a>
    (19)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-9">app/views/api/map/index.xml.builder</a>
    (8)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-10">app/views/api/nodes/index.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-11">app/views/api/nodes/show.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-12">app/views/api/old_nodes/_old_node.xml.builder</a>
    (24)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-13">app/views/api/old_nodes/history.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-14">app/views/api/old_nodes/version.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-15">app/views/api/old_relations/_old_relation.xml.builder</a>
    (19)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-16">app/views/api/old_relations/history.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-17">app/views/api/old_relations/version.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-18">app/views/api/old_ways/_old_way.xml.builder</a>
    (19)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-19">app/views/api/old_ways/history.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-20">app/views/api/old_ways/version.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-21">app/views/api/relations/full.xml.builder</a>
    (7)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-22">app/views/api/relations/index.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-23">app/views/api/relations/relations_for_node.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-24">app/views/api/relations/relations_for_relation.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-25">app/views/api/relations/relations_for_way.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-26">app/views/api/relations/show.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-27">app/views/api/ways/full.xml.builder</a>
    (6)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-28">app/views/api/ways/index.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-29">app/views/api/ways/show.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-30">app/views/api/ways/ways_for_node.xml.builder</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-31">config/routes.rb</a>
    (38)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-32">test/controllers/api/changesets_controller_test.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-33">test/controllers/api/map_controller_test.rb</a>
    (18)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-34">test/controllers/api/nodes_controller_test.rb</a>
    (20)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-35">test/controllers/api/old_nodes_controller_test.rb</a>
    (42)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-36">test/controllers/api/old_relations_controller_test.rb</a>
    (48)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-37">test/controllers/api/old_ways_controller_test.rb</a>
    (50)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-38">test/controllers/api/relations_controller_test.rb</a>
    (66)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223/files#diff-39">test/controllers/api/ways_controller_test.rb</a>
    (22)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2223.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2223.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2223.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2223.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2223">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJAFWPGHORKK7IYFUDPUHQE3ANCNFSM4HLMFYOQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLM7U4XFTYGF4ZMIVZ3PUHQE3A5CNFSM4HLMFYO2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GSPVNQQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2223",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2223",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>