~ubuntu-branches/ubuntu/saucy/ruby-erubis/saucy

« back to all changes in this revision

Viewing changes to examples/basic/example.eruby

  • Committer: Package Import Robot
  • Author(s): Laurent Bigonville
  • Date: 2012-01-26 15:15:58 UTC
  • Revision ID: package-import@ubuntu.com-20120126151558-9u7mnf9ooqnw3bwz
Tags: upstream-2.7.0
ImportĀ upstreamĀ versionĀ 2.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<%
 
2
   user = 'Erubis'
 
3
   list = ['<aaa>', 'b&b', '"ccc"']
 
4
 %>
 
5
<p>Hello <%= user %>!</p>
 
6
<table>
 
7
  <tbody>
 
8
    <% list.each_with_index do |item, i| %>
 
9
    <tr bgcolor="<%= i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %>">
 
10
      <td><%= i + 1 %></td>
 
11
      <td><%== item %></td>
 
12
    </tr>
 
13
    <% end %>
 
14
  </tbody>
 
15
</table>