Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #3861 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] RJS templates cause render :action => :symbol to fail

Reported by: rick@rickbradley.com Assigned to: David
Priority: normal Milestone:
Component: ActionPack Version: 1.0.0
Severity: normal Keywords: rjs template error dup symbol
Cc:

Description

Given a controller which includes code like:

def foo_action
  render :action => :symbol
end

(render_action behaves the same)

... since RJS templates were added, functional testing or rendering the view from this action will generate an error similar to the following:

TypeError: can't dup Symbol
    ./test/controller/../../lib/action_controller/base.rb:982:in `dup'
    ./test/controller/../../lib/action_controller/base.rb:982:in `default_template_name'
    ./test/controller/../../lib/action_controller/layout.rb:249:in `candidate_for_layout?'
    ./test/controller/../../lib/action_controller/layout.rb:243:in `apply_layout?'
    ./test/controller/../../lib/action_controller/layout.rb:220:in `render_without_benchmark'
    ./test/controller/../../lib/action_controller/benchmarking.rb:53:in `render'

A patch to trunk is attached which includes an actionpack unit test for the problem as well as a patch to the RJS template engine protecting the symbol from being .dup()ed by the RJS code.

Attachments

rjs_action_symbol.patch (1.5 kB) - added by rick@rickbradley.com on 02/16/06 21:09:32.
actionpack unit test and patch for this problem

Change History

02/16/06 21:09:32 changed by rick@rickbradley.com

  • attachment rjs_action_symbol.patch added.

actionpack unit test and patch for this problem

02/16/06 21:22:22 changed by rick@rickbradley.com

  • summary changed from RJS templates cause render :action => :symbol to fail to [PATCH] RJS templates cause render :action => :symbol to fail.

02/17/06 18:32:32 changed by david

  • status changed from new to closed.
  • resolution set to fixed.