diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-02-06 12:13:44 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-02-06 12:13:44 +0100 |
commit | 7a5da7ce785616d79843dfebbb5107be8b46f8c5 (patch) | |
tree | 355145e59fbf166b8f2cde23dc8a13b188384c7e /actionpack/lib/action_view | |
parent | 81c7a5d48d972c9e3973b4c018fafae1dfd9c0de (diff) | |
parent | be098f840614bbb71fe26f0e2b4c064b6866c076 (diff) | |
download | rails-7a5da7ce785616d79843dfebbb5107be8b46f8c5.tar.gz rails-7a5da7ce785616d79843dfebbb5107be8b46f8c5.tar.bz2 rails-7a5da7ce785616d79843dfebbb5107be8b46f8c5.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helper.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_view/paths.rb | 6 |
3 files changed, 9 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 f6abea38ed..a32beb6100 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -516,7 +516,8 @@ module ActionView def compute_public_path(source, dir, ext = nil, include_host = true) has_request = @controller.respond_to?(:request) - if ext && (File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}"))) + source_ext = File.extname(source)[1..-1] + if ext && (source_ext.blank? || (ext != source_ext && File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}")))) source += ".#{ext}" end diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 2ac2427884..0651f75cfb 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -971,7 +971,8 @@ module ActionView @template.fields_for(child_name, child, *args, &block) end.join else - @template.fields_for(name, association, *args, &block) + object = args.first.respond_to?(:new_record?) ? args.first : association + @template.fields_for(name, object, *args, &block) end end diff --git a/actionpack/lib/action_view/paths.rb b/actionpack/lib/action_view/paths.rb index ee26542a07..c7d6fd696a 100644 --- a/actionpack/lib/action_view/paths.rb +++ b/actionpack/lib/action_view/paths.rb @@ -2,7 +2,11 @@ module ActionView #:nodoc: class PathSet < Array #:nodoc: def self.type_cast(obj) if obj.is_a?(String) - Template::EagerPath.new(obj) + if !Object.const_defined?(:Rails) || Rails.configuration.cache_classes + Template::EagerPath.new(obj) + else + Template::Path.new(obj) + end else obj end |