Here is an example from a failed spec:
2) widgets/new renders new sentiment form
Failure/Error: render
ActionView::Template::Error:
undefined method `each' for nil:NilClass
# ./app/views/widgets/new.html.erb:13:in `_app_views_widgets_new_html_erb__3591031757452814763_2164570860'
# /Users/user/.rvm/gems/ruby-1.9.3-p194@myapp/gems/actionpack-3.2.7/lib/action_view/template.rb:145:in `block in render'
# /Users/user/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.7/lib/active_support/notifications.rb:123:in `block in instrument'
.......
What does all this mean: _app_views_widgets_new_html_erb__3591031757452814763_2164570860? Is it rendering a temporary file somewhere? Why these particular numbers?
When rails renders your templates, it first compiles them to real ruby code. You can see this in the rails source in actionpack/lib/action_view/template.rb.
This is done 3 steps.
@output_buffer += "some_text"; @output_buffer += some_expression; ...for your erb (or haml, or whatever you prefer) template.eval.The name of the method containing the compiled code is created using the scheme below (see line 325 of template.rb):
So the numbers are actually the hash of the
@identifier(which is usally the path of the template file) and the object id of the current template instance.