diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-08-09 01:45:52 -0300 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-08-09 04:12:08 -0300 |
commit | 964bc4e85517dbd45d86e91445b3b9aecde960d8 (patch) | |
tree | 77d21d03ade22c87a391ac826e67fbc085ed45c1 /actionpack/lib | |
parent | 33f01fb1f6e0bf850e9366ef8203c4c944c27540 (diff) | |
download | rails-964bc4e85517dbd45d86e91445b3b9aecde960d8.tar.gz rails-964bc4e85517dbd45d86e91445b3b9aecde960d8.tar.bz2 rails-964bc4e85517dbd45d86e91445b3b9aecde960d8.zip |
Rendering a template from ActionView will default to looking for partials only in the current mime type.
* The old behavior was tested only as a side-effect of a different test--the original tests remain;
a new template in the XML mime was added.
* If you are relying on the current behavior and object to this change, please participate in
http://groups.google.com/group/rubyonrails-core/browse_thread/thread/6ef25f3c108389bd
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/text.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 7932f01ebb..d1cd506dde 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -248,7 +248,7 @@ module ActionView #:nodoc: def with_template(current_template) _evaluate_assigns_and_ivars last_template, self.template = template, current_template - last_formats, self.formats = formats, [current_template.mime_type.to_sym] + Mime::SET.symbols + last_formats, self.formats = formats, current_template.formats yield ensure self.template, self.formats = last_template, last_formats diff --git a/actionpack/lib/action_view/template/text.rb b/actionpack/lib/action_view/template/text.rb index 81944ff546..9f12e5e0a8 100644 --- a/actionpack/lib/action_view/template/text.rb +++ b/actionpack/lib/action_view/template/text.rb @@ -15,7 +15,9 @@ module ActionView #:nodoc: def render(*) self end def mime_type() @content_type end - + + def formats() [mime_type] end + def partial?() false end end end |