title: undefined method `parent' for nil:NilClass
body: <p>I'm getting this strange error using Rails 3.0.2.</p>
  
  <pre><code>ActionView::Template::Error (undefined method `parent' for nil:NilClass):
  app/controllers/channels_controller.rb:19:in `index'
  </code></pre>
  
  <p>This is the controller, and line <code>19</code> is the <code>respond_with(@channels)</code> block.</p>
  
  <p>Where do I start to search for errors?</p>
  
  <pre><code>class ChannelsController &lt; ApplicationController
    before_filter :set_default_client
    respond_to :html, :xml
  
    def index
      if params[:cache_set]
        @channels = Channel.active.find_all_by_id(params[:cache_set])
      else
        @channels = Channel.active.find_all_by_id(cookies[:channels].split(','))
      end
  
      respond_with(@channels)
    end
  end
  </code></pre>
  
  <p>This is the full error:</p>
  
  <pre><code>ActionView::Template::Error (undefined method `parent' for nil:NilClass):
    app/controllers/channels_controller.rb:19:in `index'
  
  Rendered /Users/linus/.rvm/gems/ruby-1.8.7-p330/gems/actionpack-3.0.2/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms)
  Rendered /Users/linus/.rvm/gems/ruby-1.8.7-p330/gems/actionpack-3.0.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (19.8ms)
  Rendered /Users/linus/.rvm/gems/ruby-1.8.7-p330/gems/actionpack-3.0.2/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (28.6ms)
  </code></pre>
  
  <p>I'm using Ruby 1.8.7 with Rails 3.0.2.
  I've also, just in case, tried Rails 3.0.7 and 3.0.0.</p>