Saving association with existing model
<p>Im building a movie ticketing app in which I have movies and each movie has many showtimes.</p>

<p>This is my movie class:</p>

<pre><code>class Movie &lt; ActiveRecord::Base
  has_many :showtimes, dependent: :destroy

end
</code></pre>

<p>and showtime class</p>

<pre><code>class Showtime &lt; ActiveRecord::Base
  belongs_to :movie

end
</code></pre>

<p>In my showtime form I have the following field</p>

<pre><code>&lt;%= f.collection_select :movie, Movie.all, :id, :title %&gt;
</code></pre>

<p>In my showtime controller do I have the following create method</p>

<pre><code>  def create
    @showtime = Showtime.new(showtime_params)
    if @showtime.save
      redirect_to @showtime, notice: 'Showtime was successfully created.'
    else
      render :new
    end
  end

  def showtime_params
    params.require(:showtime).permit(:movie_id, :start_time)
  end
</code></pre>

<p>I this the correct approach to saving that association?</p>