title: How can I redirect after an action is performed in my controller?
body: <p>I have a form set up to take in date time value. This value will then be sent as a parameter into my controller method "bookingdate" where it will be compared with other dates in the bookings to ensure there is no double booking, using a do loop.</p>
  
  <p>However when I submit the date form, rather than redirect to the next form where a user selects other details it throws me an error or redirects incorrectly.</p>
  
  <p>Here is my controller</p>
  
  <pre><code>def bookingdate
  
    @bookings = Booking.all
    @bookings.each do |b|
      if b.startdatetime == params[:startdatetime]
        @musicians = Musician.where (["id != ?", b.musician_id])
      end
    end
  
    render :action =&gt; 'new'
  end
  </code></pre>
  
  <p>Here is my routes</p>
  
  <pre><code>match '/bookdate', :to =&gt; 'bookings#bookingdate'
  </code></pre>