Return XML builder response to variable in controller in Rails 5 -


i have object @product , xml builder in views directory called download.xml.builder

i using code generate xml file:

format.xml { send_data(render_to_string(:template=>"download" ), :type=>"text/xml",:filename => "download.xml") } 

but need controller not generate file stores xml variable @download (i use send soap api)

i checked old project (rails 3) correct xml builder, , can suggest try similar solution:

some_controller.rb

def getxml   respond_to :xml end 

views/some/getxml.xml.builder

xml.instruct! xml.some_tag {   xml.simple_string "some string"    xml.simple_node {     xml.foo "..."     xml.bar "..."   } } 

i'm not sure, using soap api, hope point way.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -