<p>During review of <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="432783232" data-permission-text="Issue title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/2207" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/2207/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/2207">#2207</a> I realised that we can simplify a bunch of our partial calls. For example, if <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=279193" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/trace">@trace</a> is a <code>Trace</code> model, then instead of:</p>
<pre><code><%= render :partial => "trace", :object => @trace %>
</code></pre>
<p>... you can instead call...</p>
<pre><code><%= render @trace %>
</code></pre>
<p>... and Rails will find the partial named after the model, and pass the object into the partial automatically. It also works with collections.</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/2278'>https://github.com/openstreetmap/openstreetmap-website/pull/2278</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Simplify partial rendering when the partial is named after the model</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-0">app/views/api/notes/index.gpx.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-1">app/views/api/notes/index.json.jsonify</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-2">app/views/api/notes/index.rss.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-3">app/views/api/notes/index.xml.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-4">app/views/api/notes/show.gpx.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-5">app/views/api/notes/show.json.jsonify</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-6">app/views/api/notes/show.rss.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-7">app/views/api/notes/show.xml.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-8">app/views/api/users/index.builder</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-9">app/views/api/users/show.builder</a>
    (2)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-10">app/views/diary_entries/_diary_index_entry.html.erb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-11">app/views/diary_entries/index.html.erb</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-12">app/views/diary_entries/show.html.erb</a>
    (2)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-13">app/views/redactions/_redactions.html.erb</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-14">app/views/redactions/index.html.erb</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-15">app/views/traces/index.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2278/files#diff-16">app/views/users/index.html.erb</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2278.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2278.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2278.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2278.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/2278?email_source=notifications&email_token=AAK2OLLZ62KRVUE7VCY4YI3P4NNDPA5CNFSM4H3RUNHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3ZK6HQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLK7ZLVZZWRLDIUQ7ZDP4NNDPANCNFSM4H3RUNHA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLKRIFY35YAEK3JTWNDP4NNDPA5CNFSM4H3RUNHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3ZK6HQ.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/2278?email_source=notifications\u0026email_token=AAK2OLLZ62KRVUE7VCY4YI3P4NNDPA5CNFSM4H3RUNHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3ZK6HQ",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2278?email_source=notifications\u0026email_token=AAK2OLLZ62KRVUE7VCY4YI3P4NNDPA5CNFSM4H3RUNHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3ZK6HQ",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>