title: How do I set up my model associations for an conference registration app?
body: <p>I've been playing around with writing a RoR 4.2 app that will allow the following behaviors:</p>
  
  <ol>
  <li>Admin users to create a list of conference courses that will include topic, description, etc</li>
  <li>Conference attendees can register with the website and then select the conference courses they'd like to attend.</li>
  <li>Conference attendees should not be able to create conference courses, only to select from a list of courses listed in the database and to select them to attend. The must be a way to associate many users with the same course.</li>
  <li>When a user selects a course, the seating capacity for that course should be decremented (the details of this aspect of the solution are a secondary requirement at the time)</li>
  </ol>
  
  <p>For the sake of discussion, let's say I am using Devise with user roles all figured out and configured. So I have one user.rb model/table. 
  I also created a model/table called course.rb.
  I created a join model/table called course_selection.rb.</p>
  
  <p>I configured these tables using the has_many through associations with the join table belonging to each like so:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :course_selections
    has_many :courses, :through =&gt; :course_selections
  end
  
  class Course &lt; ActiveRecord::Base
    has_many :course_selections
    has_many :users, :through =&gt; :course_selections
  end
  
  class CourseSelection &lt; ActiveRecord::Base
    belongs_to :user
    belongs_to :course
  end
  </code></pre>
  
  <p>I have this set up and am able to create new users, but the users with non-admin roles are able to create courses (but I haven't set up any kind of role based exclusions for these users to prevent them from creating courses). When I call a RESTful route such as 
  <a href="http://localhost:3000/users/3/courses" rel="nofollow">http://localhost:3000/users/3/courses</a>
  I am expecting to see only a list of courses associated with this particular user. Instead I am seeing ALL the courses listed in the database.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Can the model associations strategy I've selected be used to accomplish the behavioral goals I've specified?</li>
  <li>How would the controllers be set up so that a user's course selection is established, but that they are not using the new/create methods to actually create the course?</li>
  <li>How would the forms be set up (I'm using simple_form) to allow the user to select from the list of existing courses?</li>
  </ol>
  
  <p>Thanks for your help. I haven't found any tutorials that seem to address this challenge.</p>