What used to work with Rails 3.1.0 was:
class MyController < ApplicationController
...
def myAction
...
data = render_to_string( :template => "reports/report.xml.builder", :layout => false)
...
end
end
With Rails 3.2 I am getting a deprecation warning. How do I render an arbitrary xml builder view with Rails 3.2?
Instead of
render(:template => "reports/report.xml.builder", :layout => false)
Rails 3.2 wants
render(:template => “reports/report”, :formats => [:xml], :handlers => :builder, :layout => false)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With