0

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.

sawa
  • 165,429
  • 45
  • 277
  • 381

1 Answers1

0

i think you need a yield in there:

template :

%html
  %head
    =yield

also see: Structuring of layout template in Haml

Community
  • 1
  • 1
jai
  • 2,931
  • 1
  • 14
  • 4
  • Thanks Jai for answering. But your solution is for Rails project. But i am using ruby project which would make gem. The gem is used for creating an app structure for our platform. basically it has xmls and converting to html + js + css to deploy our platform. Please give me the solution for non rails project. – user714128 Apr 19 '11 at 14:37