<p dir="auto">Changes routes from</p>
<p dir="auto"><code class="notranslate">/user/:display_name/diary/:id/comments/:comment/hide</code></p>
<p dir="auto">to</p>
<p dir="auto"><code class="notranslate">/diary_comments/:comment/hide</code></p>
<p dir="auto">+ the same for unhide.</p>
<p dir="auto">This is what you'll get if you define comments as a shallow nested resource like this:</p>
<div class="highlight highlight-source-ruby" dir="auto"><pre class="notranslate"> <span class="pl-en">resources</span> <span class="pl-pds">:users</span><span class="pl-kos">,</span> <span class="pl-pds">:path</span> <span class="pl-c1">=></span> <span class="pl-s">"user"</span><span class="pl-kos">,</span> <span class="pl-pds">:param</span> <span class="pl-c1">=></span> <span class="pl-pds">:display_name</span> <span class="pl-k">do</span>
<span class="pl-en">resources</span> <span class="pl-pds">:diary_entries</span><span class="pl-kos">,</span> <span class="pl-pds">:path</span> <span class="pl-c1">=></span> <span class="pl-s">"diary"</span> <span class="pl-k">do</span>
<span class="pl-en">resources</span> <span class="pl-pds">:diary_comments</span><span class="pl-kos">,</span> <span class="pl-pds">:shallow</span> <span class="pl-c1">=></span> <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-pds">:only</span> <span class="pl-c1">=></span> <span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-k">do</span>
...
<span class="pl-en">end</span>
<span class="pl-k">end</span>
<span class="pl-k">end</span></pre></div>
<p dir="auto">Paths with display_name and diary entry id are too long and these names/ids are not used for anything in the controller.</p>
<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/5093'>https://github.com/openstreetmap/openstreetmap-website/pull/5093</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5093/commits/71f31bfc4c86b5daa8dc481226a56e2191a1b1fe" class="commit-link">71f31bf</a> Use shallow routes for diary comments</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5093/files">3 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5093/files#diff-09278256f628aa9b63748820a8a5bea3c5bcc191778acbb5d1f26d8f469f434c">app/views/diary_entries/_diary_comment.html.erb</a>
(4)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5093/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
(4)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5093/files#diff-2c3b3662e44be71c024967a2cefccfd23f10c363eadb2985ff4896454b01845e">test/controllers/diary_comments_controller_test.rb</a>
(24)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5093.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5093.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5093.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5093.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5093">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLP2VC2UIDAVIBRUORLZR45WLAVCNFSM6AAAAABMVL67KWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ3TCNJQGI2DGMQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOOMMTK6DYV2XTCVSTZR45WLA5CNFSM6AAAAABMVL67KWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHJGUBCMA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5093</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5093",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5093",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>