Template + Haml + custom body
I have xml which I need to parse and make into an html page.
The contents of the parsed xml have to go inside the body of the html page but the header and html tag come from the template.
For example:
%html
%head .....
These two elements in the template and the parsed xml (converted haml elements) have to go into the body.
开发者_运维知识库%html
%head
%meta-name#content..
%body
%parsed xml (converted haml)
Please give a solution for achieving this using ruby haml.
i think you need a yield in there:
template :
%html
%head
=yield
also see: Structuring of layout template in Haml
精彩评论