title: Creating controllers and views for a has_many :through relationship in Rails 3
body: <p>There are many tutorials that show you how to create the model instructions for a has_many :through relationship in Rails, but there doesn't seem to be many articles related to the process of setting up forms to create and edit these relationships. I am seeking some assistance (or good examples) of how to create an interface that will allow users to manage these types of relationships in a Rails app.</p>
  
  <p>Here's the scenario:</p>
  
  <blockquote>
    <p>I have Users, Relationships, and Athletes. A User can have a
    Relationship with an Athlete in a variety of roles: Coach, Mentor,
    Parent, or Fan.</p>
  </blockquote>
  
  <p>Here are my models:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :relationships
    has_many :athletes, :through =&gt; :relationships
  end
  
  class Athlete &lt; ActiveRecord :: Base
    has_many :relationships
    has_many :users, :through =&gt; :relationships
  end
  
  class Relationship &lt; ActiveRecord :: Base
    belongs_to :users
    belongs_to :athletes
  end
  </code></pre>
  
  <p>So, the next step is to build the views and controllers that allows me to create a User-to-Athlete relationship (with a coach, parent, etc role), edit the relationship, or destroy the relationship.</p>
  
  <p>Ultimately, my aim is to have a scenario where Users can create Athletes and choose the associated Relationship.</p>
  
  <p>Unfortunately, I can't find any specific tutorials or references that gives me much more than the model instructions or the example for a has_many relationship.</p>
  
  <p>If anyone has a link or example that can solve this problem at a simple level, I should be able to customize the rest.</p>