title: undefined method `map' for nil:NilClass , what causes this?
body: <p>Hi i am facing this error ,
  completely new to rails so cant figure out what is causing it</p>
  
  <p>my newBook.html.erb</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt; new Book &lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;&lt;%= @hello_message %&gt;&lt;/h1&gt;
          &lt;h1&gt;Add new book&lt;/h1&gt;
          &lt;%= form_tag :action =&gt; 'create' %&gt;
          &lt;p&gt;
              &lt;label for="book_title"&gt;Title&lt;/label&gt;:
              &lt;%= text_field 'book', 'title' %&gt;
          &lt;/p&gt;
          &lt;p&gt;
              &lt;label for="book_price"&gt;Price&lt;/label&gt;:
              &lt;%= text_field 'book', 'price' %&gt;
          &lt;/p&gt;
          &lt;p&gt;
              &lt;label for="book_subject"&gt;Subject&lt;/label&gt;:
              &lt;%= collection_select(:book,:subject_id,@subjects,:id,:name) %&gt;
          &lt;/p&gt;
          &lt;p&gt;
              &lt;label for="book_description"&gt;Description&lt;/label&gt;
              &lt;br/&gt;
              &lt;%= text_area 'book', 'description' %&gt;
          &lt;/p&gt;
          &lt;%= submit_tag "Create" %&gt;
          &lt;%= end_form_tag %&gt;
          &lt;%= link_to 'Back', {:action =&gt; 'list'} %&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my book model : book.rb</p>
  
  <pre><code>class Book &lt; ActiveRecord::Base
    attr_accessible :title, :price,:description , :created_at 
    belongs_to :subject
    validates_presence_of :title
    validates_numericality_of :price, :message=&gt;"Error Message"
  end
  </code></pre>
  
  <p>my subject model : subject.rb</p>
  
  <pre><code>class Subject &lt; ActiveRecord::Base
    attr_accessible :name
    has_many :book
  
  end
  </code></pre>
  
  <p>stack trace is :</p>
  
  <pre><code>actionpack (3.2.13) lib/action_view/helpers/form_options_helper.rb:364:in `options_from_collection_for_select'
  actionpack (3.2.13) lib/action_view/helpers/form_options_helper.rb:600:in `to_collection_select_tag'
  actionpack (3.2.13) lib/action_view/helpers/form_options_helper.rb:191:in `collection_select'
  app/views/home/newBook.html.erb:19:in `_app_views_home_new_ook_html_erb__299261930_24178164'
  actionpack (3.2.13) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.13) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.13) lib/action_view/template.rb:143:in `render'
  # -- snipped --
  </code></pre>