diff options
author | Matt Jones <al2o3cr@gmail.com> | 2009-02-24 10:38:07 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-02-24 10:38:07 -0600 |
commit | b35562f432d0807517a614a540026c2fc557e2ac (patch) | |
tree | 5b6b797ce782ced42463793c7d1aa6d293d2b8d1 /actionpack/lib/action_view | |
parent | 53cd102b39eb62567298430cbd94e40dd78d46a0 (diff) | |
download | rails-b35562f432d0807517a614a540026c2fc557e2ac.tar.gz rails-b35562f432d0807517a614a540026c2fc557e2ac.tar.bz2 rails-b35562f432d0807517a614a540026c2fc557e2ac.zip |
correctly handle layouts for AJAX requests and regular js files [#2052 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/paths.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/paths.rb b/actionpack/lib/action_view/paths.rb index 41f9f486e5..37d96b2f82 100644 --- a/actionpack/lib/action_view/paths.rb +++ b/actionpack/lib/action_view/paths.rb @@ -40,7 +40,7 @@ module ActionView #:nodoc: each(&:load!) end - def find_template(original_template_path, format = nil) + def find_template(original_template_path, format = nil, html_fallback = true) return original_template_path if original_template_path.respond_to?(:render) template_path = original_template_path.sub(/^\//, '') @@ -54,9 +54,9 @@ module ActionView #:nodoc: elsif template = load_path[template_path] return template # Try to find html version if the format is javascript - elsif format == :js && template = load_path["#{template_path}.#{I18n.locale}.html"] + elsif format == :js && html_fallback && template = load_path["#{template_path}.#{I18n.locale}.html"] return template - elsif format == :js && template = load_path["#{template_path}.html"] + elsif format == :js && html_fallback && template = load_path["#{template_path}.html"] return template end end |