This project is archived and is in readonly mode.

#6785 new
David Chelimsky

3.1: params_wrapper raises error on anynomous controllers

Reported by David Chelimsky | May 16th, 2011 @ 05:13 PM

Given this code:

controller = Class.new(ApplicationController) do
  # ...
end

I get the following error:

+/Users/david/.rvm/gems/ruby-1.9.2-p180@rspec-dev/gems/activesupport-3.1.0.beta1/lib/active_support/whiny_nil.rb:48:in `method_missing': undefined method `sub' for nil:NilClass (NoMethodError)
+   from /Users/david/.rvm/gems/ruby-1.9.2-p180@rspec-dev/gems/actionpack-3.1.0.beta1/lib/action_controller/metal/params_wrapper.rb:140:in `_default_wrap_model'

This is caused by model_name = self.name.sub(/Controller$/, '').singularize on https://github.com/rails/rails/blob/8b0262f9535cb9ad2215e5ed672150e...

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

Pages