Skip to content

Instantly share code, notes, and snippets.

@FaisalAl-Tameemi
Last active January 19, 2016 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FaisalAl-Tameemi/76c5fa684800ec3c7237 to your computer and use it in GitHub Desktop.
Save FaisalAl-Tameemi/76c5fa684800ec3c7237 to your computer and use it in GitHub Desktop.
erb sample
get '/contacts' do
@contacts = [
{
first_name: "Ann",
last_name: "Simon"
},
{
first_name: "Peter",
last_name: "Gabriel"
},
{
first_name: "John",
last_name: "Smith"
},
{
first_name: "Another",
last_name: "Name"
}
]
erb :contacts
end
<ul class="nice-list">
<% @contacts.each do |current_item| %>
<li>
<%= current_item[:first_name] %>
</li>
<% end %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment