开发者

Template + Haml + custom body

开发者 https://www.devze.com 2023-02-27 01:25 出处:网络
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.

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

精彩评论

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