title: Why does link_to when used in a partial return a link to the parent object rather than the actual object?
body: <p>So I have two models, Users that belong_to Organization (which has_many users). I'm using a partial to display all the users that belong to any one particular organization, and this is working fine if I output just the name (it correctly names all the users). However when I change the partial code to provide link_to user.name, the returned links are all links to the parent Organization rather than the individual child objects. What am I doing wrong?</p>
  
  <p>Relevant code:</p>
  
  <p>Organizations Controller</p>
  
  <pre><code>def show
  @organization = Organization.find(params[:id])
  @users_index = User.joins(:organization).where(organizations: {id: @organization.id})
  end
  </code></pre>
  
  <p>Organization.show.html.erb</p>
  
  <pre><code>&lt;% provide(:title, @organization.organization_name) %&gt;
  &lt;h1&gt;&lt;%= @organization.organization_name %&gt;&lt;/h1&gt;
  &lt;h2&gt;Your Organization's Users:&lt;/h2&gt;
  &lt;%= render partial: "users_index", collection: @users_index %&gt;
  </code></pre>
  
  <p>_users_index.html.erb code:</p>
  
  <pre><code>&lt;p class="users"&gt;&lt;%= link_to users_index.name %&gt;&lt;/p&gt;
  </code></pre>