title: How to model a playlist in Rails
body: <p>I’m creating a website for a record company I’m starting.</p>
  
  <p>Right now I have a working artist (user) model with validation. I now need to create a way for artists create a playlist with their songs. I also need this music to be downloadable for everyone.</p>
  
  <p>This is my thinking:</p>
  
  <p>Create an Album model and a Song model.</p>
  
  <pre><code>class Album &lt; ActiveRecord::Base
    belongs_to :artist
    has_many :songs
  end
  
  class Song &lt; ActiveRecord::Base
    belongs_to :album
  end
  </code></pre>
  
  <p>An artist will create an Album using an Album form. Then on a separate form they will create a Song that will belong to a certain Album. They will add each Song to an Album separately, so if they have 10 Songs in one Album they will fill out the Song form 10 times.</p>
  
  <p>On the Artist show page, I can call the Artist’s Album to display a list of Songs belonging to that Album. Those songs will then be playable via a player of some sort. Then when an non-logged-in-user clicks on a download button, they are brought to a download page where they can download a .zip file of the Album with the Songs nicely packaged up.</p>
  
  <p>I want this to be very similar to the way Bandcamp does it.</p>
  
  <p>How can I go about doing this? or at least get started?</p>