title: Why do I get the error `undefined method 'map'`?
body: <p>In my Ruby on Rails application I am trying to display a three drop down menus in the _form.html.erb which are rendered from the file _booking_lookup.html.erb and get there data from the drop down menu methods in the models.</p>
  
  <p>_form.html.erb:</p>
  
  <pre><code>&lt;%= render(:partial =&gt; '/booking_lookup', :locals=&gt; {:film =&gt; @film = Film.all, :showings =&gt; @showings = Showing.all, :seats =&gt; @seats = Seat.all, :my_path =&gt; '/films/booking_lookup' }) %&gt;
  </code></pre>
  
  <p>_booking_lookup.html.erb:</p>
  
  <pre><code>&lt;%= form_tag my_path, :method=&gt;'post', :multipart =&gt; true do %&gt;
  &lt;%= select_tag ('title_id'), 
      options_from_collection_for_select(@films, :id, :title_info, 0 ),
      :prompt =&gt; "Film" %&gt;
  
  &lt;%= select_tag ('showings_id'), 
      options_from_collection_for_select(@showings, :id, :showing_times, 0 ),
      :prompt =&gt; "Showings" %&gt; 
  
  &lt;%= select_tag ('seat_id'), 
      options_from_collection_for_select(@seats, :id, :seats_available, 0 ),
      :prompt =&gt; "Seats" %&gt; 
  
  &lt;%= submit_tag 'Search' %&gt;
  </code></pre>
  
  
  
  <p>film.rb:</p>
  
  <pre><code>class Film &lt; ActiveRecord::Base
  
  has_many :showings
  belongs_to :certificate
  belongs_to :category
  
  def title_info
       "#{title}"
  end
  end
  </code></pre>
  
  <p>seat.rb:</p>
  
  <pre><code>class Seat &lt; ActiveRecord::Base
  belongs_to :screen
  has_many :bookings
  
  def seats_available
      "#{row_letter}#{row_number}"
  end
  end
  </code></pre>
  
  <p>showing.rb:</p>
  
  <pre><code> class Showing &lt; ActiveRecord::Base
    belongs_to :film
    has_many :bookings
    belongs_to :screen
  
      def showing_times
          "#{show_date.strftime("%e %b %Y")} @ #{show_time.strftime("%H:%M")}"
      end
  end
  </code></pre>
  
  <p>But for some reason with the line: <code>&lt;%= select_tag ('title_id'), 
          options_from_collection_for_select(@films, :id, :title_info, 0 ),
          :prompt =&gt; "Film" %&gt;</code> I get the error: </p>
  
  <pre><code>NoMethodError in Bookings#new 
  undefined method `map' for nil:NilClass
  </code></pre>
  
  <p>The weird part is that I am using a lot of this code else where, I have a _multi_search.html.erb form:</p>
  
  <pre><code> &lt;%= form_tag my_path, :method=&gt;'post', :multipart =&gt; true do %&gt;
   &lt;!--  Genre: --&gt;
   Search By:
   &lt;%= select_tag ('cat_id'), 
      options_from_collection_for_select(@categories, :id, :category_info, 0 ),
      :prompt =&gt; "Genre" %&gt;
  
  &lt;%= select_tag ('cert_id'), 
      options_from_collection_for_select(@certificates, :id, :certificate_info, 0 ),
      :prompt =&gt; "Age Rating" %&gt; 
  
  &lt;%= text_field_tag :search_string, nil, placeholder: "ACTOR" %&gt;
  or
  &lt;%= select_tag ('title_id'), 
      options_from_collection_for_select(@films, :id, :title_info, 0 ),
      :prompt =&gt; "Film" %&gt;
  &lt;%= submit_tag 'Search' %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>And is used in the application.html.erb:</p>
  
  <p><code>&lt;%= render(:partial =&gt; '/multi_search', :locals=&gt; {:categories =&gt; @categories = existing_genres, :certificates =&gt; @certificates = Certificate.all, :films =&gt; @films = Film.all, :my_path =&gt; '/films/multi_find' }) %&gt;</code></p>
  
  <p>And that works fine.</p>
  
  <p>What am I doing wrong?</p>