Skip to content

Commit

Permalink
Return the string representation from an Xml Builder when rendering a…
Browse files Browse the repository at this point in the history
… partial. #5044 [tpope]

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@6543 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
technoweenie committed Apr 20, 2007
1 parent b564d7e commit e522f75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions actionpack/lib/action_view/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,9 @@ def create_template_source(extension, template, render_symbol, locals)
body = case extension.to_sym
when :rxml
"controller.response.content_type ||= 'application/xml'\n" +
"xml = Builder::XmlMarkup.new(:indent => 2)\n" +
template
"xml ||= Builder::XmlMarkup.new(:indent => 2)\n" +
template +
"\nxml.target!\n"
when :rjs
"controller.response.content_type ||= 'text/javascript'\n" +
"update_page do |page|\n#{template}\nend"
Expand Down
3 changes: 2 additions & 1 deletion actionpack/test/fixtures/test/hello_world.rxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
xml.html do
xml.p "Hello"
end
end
"String return value"

0 comments on commit e522f75

Please sign in to comment.