I have two models; Letters and Representatives, and a join table called Subscriptions. I already have many Representatives in my database. I would like to associate one or more representatives to a letter when creating a new letter. I assume something needs to be added to the letters controller to create the association, but I'm not to Rails and a bit lost. Thank you in advance!
letter.rb
class Letter < ActiveRecord::Base
  has_many :subscriptions
  has_many :representatives, :through => :subscriptions
  accepts_nested_attributes_for :subscriptions, 
      reject_if: :all_blank, 
      allow_destroy: true
end
representative.rb
class Representative < ActiveRecord::Base
    has_many :subscriptions
    has_many :letters, :through => :subscriptions
end
subscription.rb
class Subscription < ActiveRecord::Base
    belongs_to :letter
    belongs_to :representative
end
subscription migration
class CreateSubscriptions < ActiveRecord::Migration
  def change
    create_table :subscriptions do |t|
      t.integer :letter_id
      t.interger :representative_id
      t.belongs_to :letter, index: true
      t.belongs_to :representative, index: true
      t.timestamps null: false
    end
  end
end
letter _form.html.erb
<%= simple_form_for @letter do |f| %>
  <% if @letter.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@letter.errors.count, "error") %> prohibited this letter from being saved:</h2>
      <ul>
      <% @letter.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <div class="field">
    <%= f.label :title %><br>
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label :subject %><br>
    <%= f.text_field :subject %>
  </div>
  <div class="field">
    <%= f.label :body %><br>
    <%= f.text_area :body %>
  </div>
  <div class="field">
    <%= f.label 'Recipients'%><br>
    <%= f.association :representatives, as: :check_boxes,label_method: :first_name  %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
letters_controller.rb
def new
    @letter = Letter.new
end
def create
    @letter = Letter.new(letter_params)
    respond_to do |format|
    if @letter.save
        format.html { redirect_to @letter, notice: 'Letter was successfully created.' }
        format.json { render :show, status: :created, location: @letter }
    else
        format.html { render :new }
        format.json { render json: @letter.errors, status: :unprocessable_entity }
    end
  end
end
