用于 Rails 3.1.0 的是:
class MyController < ApplicationController
...
def myAction
...
data = render_to_string( :template => "reports/report.xml.builder", :layout => false)
...
end
end
在 Rails 3.2 中,我收到了弃用警告。如何使用 Rails 3.2 呈现任意 xml 构建器视图?