title: undefined method `map' for nil:NilClass Creating a Form
body: <p>I'm trying to create a registration for students to be able to register for the sections that are available to them. However, I keep getting this error when i actually hit the create registration button. When i check the live shell it says that @student == nil meaning it's not being created properly? I'm confused as to how I could fix this though</p>
  
  <pre><code>&lt;!---REGISTRATION CONTROLLER--&gt;
  
  def new
      @registration = Registration.new
      @student = Student.find(params[:student_id])
      @info = Section.for_rank(@student.rank).for_age(@student.age).map{|s| ["Name: #{Event.find_by_id(s.event.id).name}, 
          Ranks: #{ s.max_rank == nil ? "#{Student::RANKS[s.min_rank-1][0]} and up" : "#{Student::RANKS[s.min_rank-1][0]} - #{Student::RANKS[s.max_rank-1][0]}"},
          Ages: #{ s.max_age == nil ? "#{s.min_age} and up" : "#{s.min_age} - #{s.max_age}" }", s.id] }
  end
  
  
  def create
      @registration = Registration.new(params[:registration])
      if @registration.save
          redirect_to @registration, :notice =&gt; "Successful"
      else
          render :action =&gt; 'new'
      end
  end
  
  &lt;!----MY REGISTRATION FORM --&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.hidden_field :student_id, :value =&gt; @registration.student_id %&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;div class = "field"&gt;
  &lt;%= f.select :section_id, options_for_select(@info)%&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;div class="actions"&gt;
  &lt;%= f.submit nil, :class =&gt; 'btn btn-mini'  %&gt;&lt;/th&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;!--- MY STUDENT SHOW THAT CALLS THE REGISTRATION --&gt;
  
  &lt;%= link_to 'Register ', new_registration_path(:student_id =&gt; @student.id), :class =&gt; 'btn btn-mini'  %&gt;
  </code></pre>