@@ -70,7 +70,7 @@ def compute_asset_path(path, options = {})
70
70
# Computes the full URL to a asset in the public directory. This
71
71
# method checks for errors before returning path.
72
72
def asset_path ( source , options = { } )
73
- check_errors_for ( source )
73
+ check_errors_for ( source , options )
74
74
path_to_asset ( source , options )
75
75
end
76
76
alias :path_to_asset_with_errors :asset_path
@@ -124,7 +124,7 @@ def javascript_include_tag(*sources)
124
124
125
125
if options [ "debug" ] != false && request_debug_assets?
126
126
sources . map { |source |
127
- check_errors_for ( source )
127
+ check_errors_for ( source , :type => :javascript )
128
128
if asset = lookup_asset_for_path ( source , :type => :javascript )
129
129
asset . to_a . map do |a |
130
130
super ( path_to_javascript ( a . logical_path , :debug => true ) , options )
@@ -146,7 +146,7 @@ def stylesheet_link_tag(*sources)
146
146
options = sources . extract_options! . stringify_keys
147
147
if options [ "debug" ] != false && request_debug_assets?
148
148
sources . map { |source |
149
- check_errors_for ( source )
149
+ check_errors_for ( source , :type => :stylesheet )
150
150
if asset = lookup_asset_for_path ( source , :type => :stylesheet )
151
151
asset . to_a . map do |a |
152
152
super ( path_to_stylesheet ( a . logical_path , :debug => true ) , options )
@@ -169,13 +169,13 @@ def check_dependencies!(dep)
169
169
end
170
170
171
171
# Raise errors when source does not exist or is not in the precompiled list
172
- def check_errors_for ( source )
172
+ def check_errors_for ( source , options )
173
173
source = source . to_s
174
174
return source if !self . raise_runtime_errors || source . blank? || source =~ URI_REGEXP
175
- asset = lookup_asset_for_path ( source )
175
+ asset = lookup_asset_for_path ( source , options )
176
176
177
- if asset && asset_needs_precompile? ( source , asset . pathname . to_s )
178
- raise AssetFilteredError . new ( source )
177
+ if asset && asset_needs_precompile? ( asset . logical_path , asset . pathname . to_s )
178
+ raise AssetFilteredError . new ( asset . logical_path )
179
179
end
180
180
end
181
181
0 commit comments