Я получаю эту странную ошибку при использовании Rails 3.0.2.
ActionView::Template::Error (undefined method `parent' for nil:NilClass):
app/controllers/channels_controller.rb:19:in `index'
Это контроллер, а строка 19
- это блок respond_with(@channels)
.
С чего начать поиск ошибок?
class ChannelsController < 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
Это полная ошибка:
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)
Я использую Ruby 1.8.7 с Rails 3.0.2.
Я также на всякий случай попробовал Rails 3.0.7 и 3.0.0.