Skip to content

Instantly share code, notes, and snippets.

@MilanGrubnic70
Created June 17, 2014 00:54
Show Gist options
  • Save MilanGrubnic70/a31fb2d15732f1dee358 to your computer and use it in GitHub Desktop.
Save MilanGrubnic70/a31fb2d15732f1dee358 to your computer and use it in GitHub Desktop.
CRUD Listing
<h2>Contacts</h2>
<table>
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<% @contacts.each do |contact| %>
<tr>
<td><a href="/contacts/<%= contact.id %>"</a> <%= contact.id %></td>
<td><%= contact.first_name %> </td>
<td><%= contact.last_name %> </td>
<td><%= contact.phone %> </td>
<td><%= contact.email %> </td>
<td>
<a href="/contacts/<%= contact.id %>/edit">Edit</a>
<form action="/contacts/<%= contact.id %>/delete" method="post">
<input type="submit" value="Delete">
</form>
</td>
</tr>
<% end %>
</tbody>
</table>
<a href="/contacts/new">Add Contact</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment