开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜