From 1f898981751906e14a5dd3cd6dae68f97dd60a24 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Sat, 23 Jul 2011 17:31:48 -0700 Subject: 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. --- actionpack/lib/sprockets/helpers/rails_helper.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionpack/lib') diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index a95e7c0649..ec3d36d5ad 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -72,6 +72,8 @@ module Sprockets 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. -- cgit v1.2.3