title: Rails simplifies a post method
body: <p>In online bootcamp project, I'm creating a reddit clone, and I'm at the stage where I'm developing support for accessing posts. Here's the method for displaying all of the posts in the index. </p>
  
  <pre><code>def index
     @posts = Post.all
  end
  </code></pre>
  
  <p>Here is the code that creates a link for each post, directing the user to the body of the post:</p>
  
  <pre><code>&lt;% @posts.each do |post| %&gt;
    &lt;p&gt;&lt;%= link_to post.title, post_path(post.id) %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Now the text states that "Rails lets us simplify this one step further, by allowing us to skip the post_path method altogether," and the resulting code in a separate file ends up omitting the post.id:</p>
  
  <pre><code>&lt;% @posts.each do |post| %&gt;
     &lt;p&gt;&lt;%= link_to post.title, post %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>How is that possible? Does Rails just assume the post in question has the same id in the each element? Does making this change negatively affect the readability of the code?</p>