From: Frank Reiff Date: 2007-03-23T18:49:52+09:00 Subject: Newbie templating question: how to combine multiple files Hi, I use ERB for some very basic HTML templating (no Rails!). In essence, I have normal HTML pages produced by Adobe GoLive (the WORST HTML editor ever) with a couple of simple tags along the lines of <%= @myProduct.price %>. Now, I'm planning to replace GoLive's templating mechanism with ruby. Ideally, the solution would look something like this: * each file is a simple HTML file that remains editable in a normal HTML editor, e.g. Hello World

* the template itself is an HTML file that remains editable in a normal HTML editor, something along these lines:
<%= headertag() %>
<%= content() %> Looking at the documentation for the ERB class, I can't find a simple way of including another template inside a template file. I guess I could simply do a require, but that will simply copy the entire contents of the file as ruby code. How do you usually subdivide your templates into multiple files (e.g. header, variable content, footer, etc.) using ERB? Are there any better templating solutions available that could deal with combining multiple HTML pages into a single one? Any help would be appreciated. Best regards, Frank -- Posted via http://www.ruby-forum.com/.