Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

3.1: params_wrapper raises error on anynomous controllers

#6785

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...

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

State: new
Milestone: none
Assigned to: José Valim José Valim
Importance: none