Skip to content

Instantly share code, notes, and snippets.

@meltzerj
Created April 22, 2011 20:19
Show Gist options
  • Select an option

  • Save meltzerj/937499 to your computer and use it in GitHub Desktop.

Select an option

Save meltzerj/937499 to your computer and use it in GitHub Desktop.
ActionView::Template::Error (You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.to_key):
1: $("#<%= dom_id(@comment.comment_title) %>").parent().append('<%= escape_javascript(render(@comment)) %>');
2: $(".comment_form")[0].reset();
app/views/comments/create.js.erb:1:in `_app_views_comments_create_js_erb___503385093_2173588800_0'
app/controllers/comments_controller.rb:8:in `create'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment