lib/sprockets/helpers/rails_helper.rb in actionpack-3.1.1.rc2 vs lib/sprockets/helpers/rails_helper.rb in actionpack-3.1.1.rc3
- old
+ new
@@ -6,13 +6,10 @@
extend ActiveSupport::Concern
include ActionView::Helpers::AssetTagHelper
def asset_paths
@asset_paths ||= begin
- config = self.config if respond_to?(:config)
- config ||= Rails.application.config
- controller = self.controller if respond_to?(:controller)
paths = RailsHelper::AssetPaths.new(config, controller)
paths.asset_environment = asset_environment
paths.asset_digests = asset_digests
paths.compile_assets = compile_assets?
paths.digest_assets = digest_assets?
@@ -129,9 +126,11 @@
def asset_for(source, ext)
source = source.to_s
return nil if is_uri?(source)
source = rewrite_extension(source, nil, ext)
asset_environment[source]
+ rescue Sprockets::FileOutsidePaths
+ nil
end
def digest_for(logical_path)
if digest_assets && asset_digests && (digest = asset_digests[logical_path])
return digest