Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simple fix to the NoMethodError noted in #2177.

Unfortunately #respond_to?(:controller) won't work as suggested, nor will respond_to?(:params), as #controller is present and #params is delegated to #controller. #delegate makes respond_to? return true regardless whether the target responds to it.
  • Loading branch information...
commit dbca49bb32a72c0c241b1b15452804773f8dc37c 1 parent be48abb
@Empact Empact authored tenderlove committed
View
2  actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -72,6 +72,8 @@ def asset_path(source, default_ext = nil, body = false, protocol = nil)
def debug_assets?
params[:debug_assets] == '1' ||
params[:debug_assets] == 'true'
+ rescue NoMethodError
+ false
end
# Override to specify an alternative prefix for asset path generation.
View
1  actionpack/test/template/sprockets_helper_test.rb
@@ -14,7 +14,6 @@ def setup
super
@controller = BasicController.new
- @controller.stubs(:params).returns({})
@request = Class.new do
def protocol() 'http://' end
Please sign in to comment.
Something went wrong with that request. Please try again.