How do I use layouts with XML in Ruby on Rails? When using HTML a file application.html.erb with a <%= yield %> is enough, but that didn’t work for XML. A file named application.xml.builder gets executed, but the yield doesn’t work (without <%= %> of course). What is the way to do this?
How do I use layouts with XML in Ruby on Rails? When using HTML
Share
You need to append the result of the yield to output being produced. Here’s an example
application.xml.builderthat demonstrates this technique: