<h1>Simple expression</h1> 
<p>Tommy is <%= @age %> years old.</p> 	

<h1>Iteration using scriptlets</h1> 
<% for i in 1..5 %> 
  <p>Heading number <%= i %> </p> 
<% end %> 

<h1>A simple table</h1> 
<table> 
  <tr> 
    <% @table["headings"].each do |head| %> 
      <td> 
        <b><%= head %></b> 
      </td> 
    <% end %> 
  </tr> 
  <% @table["body"].each do |row| %> 
    <tr> 
      <% row.each do |col| %> 
        <td> 
           <%= col %> 
        </td> 
      <% end %> 
    </tr> 
  <% end %> 
</table> 
