aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-04-14 15:01:47 -0500
committerJoshua Peek <josh@joshpeek.com>2008-04-14 15:01:47 -0500
commit93641f30b7b2b330b28feb8d0bd49d736af3d7e9 (patch)
tree2809161ea3b98055165ff5f04b2e039ea01f1cc0 /actionpack/lib/action_view/helpers
parent420c4b3d8878156d04f45e47050ddc62ae00c68c (diff)
parent89237fe07e9c6d35687b3a473f09f4608a3625d8 (diff)
downloadrails-93641f30b7b2b330b28feb8d0bd49d736af3d7e9.tar.gz
rails-93641f30b7b2b330b28feb8d0bd49d736af3d7e9.tar.bz2
rails-93641f30b7b2b330b28feb8d0bd49d736af3d7e9.zip
Merge branch 'master' of git://github.com/stephencelis/rails
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index 2f2e9f79c7..0cce96b184 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -474,7 +474,7 @@ module ActionView
ActionView::Base.computed_public_paths[cache_key] ||=
begin
- source += ".#{ext}" if File.extname(source).blank? && ext
+ source += ".#{ext}" if ext && File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}"))
if source =~ %r{^[-a-z]+://}
source
@@ -566,7 +566,7 @@ module ActionView
def expand_javascript_sources(sources)
if sources.include?(:all)
- all_javascript_files = Dir[File.join(JAVASCRIPTS_DIR, '*.js')].collect { |file| File.basename(file).split(".", 0).first }.sort
+ all_javascript_files = Dir[File.join(JAVASCRIPTS_DIR, '*.js')].collect { |file| File.basename(file).gsub(/\.\w+$/, '') }.sort
@@all_javascript_sources ||= ((determine_source(:defaults, @@javascript_expansions).dup & all_javascript_files) + all_javascript_files).uniq
else
expanded_sources = sources.collect do |source|
@@ -579,7 +579,7 @@ module ActionView
def expand_stylesheet_sources(sources)
if sources.first == :all
- @@all_stylesheet_sources ||= Dir[File.join(STYLESHEETS_DIR, '*.css')].collect { |file| File.basename(file).split(".", 0).first }.sort
+ @@all_stylesheet_sources ||= Dir[File.join(STYLESHEETS_DIR, '*.css')].collect { |file| File.basename(file).gsub(/\.\w+$/, '') }.sort
else
sources.collect do |source|
determine_source(source, @@stylesheet_expansions)