title: Creating form for associated has_many model
body: <p>I have a 'Business' model which has_many 'Hours'. Each Hour record has a start_time and an end_time, 
  and there's an Hour record for each day of the week for a given business.</p>
  
  <p>I have a form where I only update the hours for a business -- nothing else about the business. In that case it makes sense to have the Hours controller do the updating. But I can't figure out exactly how to set the form up correctly. </p>
  
  <p>Here's what I have so far, but with each hour sent as a param, I need to know if it's the start_time or end_time and which day it's associated with. In the select_tag, hour.day contains an integer 0-6 which represents a day of the week (Sunday through Saturday).</p>
  
  <pre><code>=form_tag({:controller =&gt; 'hours', :action =&gt; "update_multiple"}, :remote =&gt; :true) do |f|
  
    -business.hours.each do |hour|
      =fields_for hour do |hour_fields|
        =select_tag 'hour[days_nums][#{hour.day}]', options_for_select(possible_hours, :start_time)
  
  class Business &lt; ActiveRecord::Base
  
    has_many :hours, :as =&gt; :hourable
    accepts_nested_attributes_for :hours
  
  end
  
  class Hour &lt; ActiveRecord::Base
  
    belongs_to :hourable, :polymorphic =&gt; true
  
  end
  
  
  create_table "hours", :force =&gt; true do |t|
    t.integer  "hourable_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "hourable_type"
    t.integer  "day"
    t.time     "start_time"
    t.time     "stop_time"
  end
  </code></pre>
  
  <p>How can I set this up?
  Thanks!</p>