@@ -77,7 +77,7 @@ def compute_asset_path(path, options = {})
77
77
# Computes the full URL to a asset in the public directory. This
78
78
# method checks for errors before returning path.
79
79
def asset_path ( source , options = { } )
80
- check_errors_for ( source )
80
+ check_errors_for ( source , options )
81
81
path_to_asset ( source , options )
82
82
end
83
83
alias :path_to_asset_with_errors :asset_path
@@ -131,7 +131,7 @@ def javascript_include_tag(*sources)
131
131
132
132
if options [ "debug" ] != false && request_debug_assets?
133
133
sources . map { |source |
134
- check_errors_for ( source )
134
+ check_errors_for ( source , :type => :javascript )
135
135
if asset = lookup_asset_for_path ( source , :type => :javascript )
136
136
asset . to_a . map do |a |
137
137
super ( path_to_javascript ( a . logical_path , :debug => true ) , options )
@@ -153,7 +153,7 @@ def stylesheet_link_tag(*sources)
153
153
options = sources . extract_options! . stringify_keys
154
154
if options [ "debug" ] != false && request_debug_assets?
155
155
sources . map { |source |
156
- check_errors_for ( source )
156
+ check_errors_for ( source , :type => :stylesheet )
157
157
if asset = lookup_asset_for_path ( source , :type => :stylesheet )
158
158
asset . to_a . map do |a |
159
159
super ( path_to_stylesheet ( a . logical_path , :debug => true ) , options )
@@ -176,13 +176,13 @@ def check_dependencies!(dep)
176
176
end
177
177
178
178
# Raise errors when source does not exist or is not in the precompiled list
179
- def check_errors_for ( source )
179
+ def check_errors_for ( source , options )
180
180
source = source . to_s
181
181
return source if !self . raise_runtime_errors || source . blank? || source =~ URI_REGEXP
182
- asset = lookup_asset_for_path ( source )
182
+ asset = lookup_asset_for_path ( source , options )
183
183
184
- if asset && asset_needs_precompile? ( source , asset . pathname . to_s )
185
- raise AssetFilteredError . new ( source )
184
+ if asset && asset_needs_precompile? ( asset . logical_path , asset . pathname . to_s )
185
+ raise AssetFilteredError . new ( asset . logical_path )
186
186
end
187
187
end
188
188
0 commit comments