This project is archived and is in readonly mode.

#609 ✓resolved
Daniel Guettler

current_render_extension nil after render :inline

Reported by Daniel Guettler | July 13th, 2008 @ 04:56 AM | in 2.x

When calling render :inline => 'Some inline content' within a template current_render_extension will become nil which will cause the CacheHelper cache method to call to_sym on nil.

Example:

<%= render :inline => "Some content inline" %>
<% cache do %>
  Cache some content here...
<% end %>

will give the following error:

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.to_sym
vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb:36:in `cache'
app/views/users/index.html.erb:2:in `_run_erb_47app47views47users47index46html46erb'
vendor/rails/actionpack/lib/action_view/base.rb:342:in `send'
vendor/rails/actionpack/lib/action_view/base.rb:342:in `execute'
vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb:29:in `send'
vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb:29:in `render'
vendor/rails/actionpack/lib/action_view/template.rb:35:in `render'
vendor/rails/actionpack/lib/action_view/template.rb:22:in `render_template'
vendor/rails/actionpack/lib/action_view/base.rb:248:in `render_file'

I attached a possible patch for the cache method but I'm not sure if this shouldn't be prevented elsewhere as well...

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Referenced by

Pages