2

I would like to create general layout file for XML response. For example I would like to wrap those general part of RSS in the layout and leave the content be generated in the corresponding view file.

For example,

# in layout/rss.xml.builder
xml.instruct!
...... # other general stuff for RSS

  yield

# in items/show.xml.builder
xml.item ......

So the item show view no need to worry the RSS wrappings.

However the yield is not working and only the layout is rendered, but the view returned nothing.

Please help.

1
  • No one answer or has any idea? Commented Jul 5, 2011 at 17:19

1 Answer 1

5

Try:

xml.instruct!
  xml << yield
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.