Skip to content

Instantly share code, notes, and snippets.

@benaskins
Created February 10, 2009 05:09
Show Gist options
  • Select an option

  • Save benaskins/61249 to your computer and use it in GitHub Desktop.

Select an option

Save benaskins/61249 to your computer and use it in GitHub Desktop.
NoMethodError in Weather#index
Showing app/views/layouts/application.haml where line #171 raised:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.include?
Extracted source (around line #171):
168: %ul
169: %li
170: - @most_viewed_articles.each do |a|
171: = link_to a.title, news_path(a)
172: .box
173: %h4
174: Latest forum posts
RAILS_ROOT: /Users/benj/Development/client_projects/swellnet
Application Trace | Framework Trace | Full Trace
vendor/rails/activerecord/lib/active_record/attribute_methods.rb:142:in `create_time_zone_conversion_attribute?'
vendor/rails/activerecord/lib/active_record/attribute_methods.rb:75:in `define_attribute_methods'
vendor/rails/activerecord/lib/active_record/attribute_methods.rb:71:in `each'
vendor/rails/activerecord/lib/active_record/attribute_methods.rb:71:in `define_attribute_methods'
vendor/rails/activerecord/lib/active_record/attribute_methods.rb:242:in `method_missing'
app/views/layouts/application.haml:171
app/views/layouts/application.haml:170:in `each'
app/views/layouts/application.haml:170
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment