1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

issue a warning when we cannot construct a controller

This commit is contained in:
Aaron Patterson 2012-07-28 20:40:27 -07:00
parent f79b29a5a8
commit 1f870a2c59

View file

@ -529,11 +529,19 @@ module ActionController
@response = TestResponse.new
@response.request = @request
@controller = nil unless defined? @controller
if klass = self.class.controller_class
@controller ||= klass.new rescue nil
unless @controller
begin
@controller = klass.new
rescue
warn "could not construct controller #{klass}" if $VERBOSE
end
end
end
if defined?(@controller) && @controller
if @controller
@controller.request = @request
@controller.params = {}
end