diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-04-22 17:16:28 -0700 |
---|---|---|
committer | Yehuda Katz and Carl Lerche <wycats@gmail.com> | 2009-04-22 17:24:41 -0700 |
commit | 0a132c2fe13fb2b8d5dade9cf6abd70601376287 (patch) | |
tree | cf9194a0a9df3cf36e7a1ffbe8b8e16274c94ee9 /actionpack/lib/action_view/paths.rb | |
parent | b2d6fdae353be4fca41d7ac1839f30d9737162fd (diff) | |
download | rails-0a132c2fe13fb2b8d5dade9cf6abd70601376287.tar.gz rails-0a132c2fe13fb2b8d5dade9cf6abd70601376287.tar.bz2 rails-0a132c2fe13fb2b8d5dade9cf6abd70601376287.zip |
Refactor ActionView::Path
* Decouple from ActionController and ActionMailer
* Bring back localization support.
* Prepare to decouple templates from the filesystem.
* Prepare to decouple localization from ActionView
* Fix ActionMailer to take advantage of ActionView::Path
Diffstat (limited to 'actionpack/lib/action_view/paths.rb')
-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 1d0279889c..e48088f344 100644 --- a/actionpack/lib/action_view/paths.rb +++ b/actionpack/lib/action_view/paths.rb @@ -33,18 +33,18 @@ module ActionView #:nodoc: super(*objs.map { |obj| self.class.type_cast(obj) }) end - def find_by_parts(path, extension = nil, prefix = nil, partial = false) + def find_by_parts(path, details = {}, prefix = nil, partial = false) template_path = path.sub(/^\//, '') each do |load_path| - if template = load_path.find_by_parts(template_path, extension, prefix, partial) + if template = load_path.find_by_parts(template_path, details, prefix, partial) return template end end Template.new(path, self) rescue ActionView::MissingTemplate => e - extension ||= [] + extension = details[:formats] || [] raise ActionView::MissingTemplate.new(self, "#{prefix}/#{path}.{#{extension.join(",")}}") end |