mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
1
actionpack/test/fixtures/test/greeting.xml.erb
vendored
Normal file
1
actionpack/test/fixtures/test/greeting.xml.erb
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<p>This is grand!</p>
|
||||
Reference in New Issue
Block a user