HTML+ERB is an actively used template created in 2004.

15Years Old 1,020Users 0Jobs

Example code from the web:

<ul>
<% 4.times do %>

  <li>list item</li>

<% end %>
</ul>

Example code from Linguist:

<% provide(:title, @header) %>
<% present @users do |user_presenter| %>
	<div class="row key-header">
		<h1><%= @header %></h1>
	</div>

	<div class='row'>
		<div class='small-12 columns'>
			<%= will_paginate %>
		</div>
	</div>
	<div class="row key-table">
		<div class="small-12 columns">
			<div class="row key-table-row">
				<div class="small-2 columns">Name</div>
				<div class="small-3 columns">Email</div>
				<div class="small-1 columns">Chords</div>
				<div class="small-1 columns">Keys</div>
				<div class="small-1 columns">Tunings</div>
				<div class="small-1 columns">Credits</div>
				<div class="small-1 columns">Prem?</div>
				<div class="small-2 columns">Since?</div>
			</div>

			<% if @users == [] %>
				<div class="row key-table-row">
					<div class="small-4 small-centered columns">No Users</div>
				</div>
			<% else %>
				<%= render @users %>
			<% end %>
		</div>
	</div>
	<div class='row'>
		<div class='small-12 columns'>
			<%= will_paginate %>
		</div>
	</div>
<% end %>

Example code from Wikipedia:

class ERBExample
    attr_accessor:variable1
    
    # using bind to access class variables
    def render()
        renderer.result(binding)
    end

    def initialize(variable1)
        @variable1 = variable1
    end

    # Expose private binding() method.
    def get_binding
        binding()
    end
end

example = ERBExample.new(variable1)
renderer = ERB.new(template)
puts output = renderer.result(example.get_binding)
Edit

Last updated February 11th, 2019