Rendering ERB
require 'erb'
some_template_string = <<-TEXT
The top
<% 5.times do |i| %>
Item <%= i + 1 %>
<% end %>
The bottom
TEXT
puts ERB.new(some_template_string).resultThe top
Item 1
Item 2
Item 3
Item 4
Item 5
The bottomLast updated
require 'erb'
some_template_string = <<-TEXT
The top
<% 5.times do |i| %>
Item <%= i + 1 %>
<% end %>
The bottom
TEXT
puts ERB.new(some_template_string).resultThe top
Item 1
Item 2
Item 3
Item 4
Item 5
The bottomLast updated