mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05: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:
parent
33f01fb1f6
commit
964bc4e855
3 changed files with 5 additions and 2 deletions
|
@ -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>
|
Loading…
Reference in a new issue