Skip to content

Instantly share code, notes, and snippets.

@benphelps
Created January 17, 2014 19:37
Show Gist options
  • Select an option

  • Save benphelps/8479986 to your computer and use it in GitHub Desktop.

Select an option

Save benphelps/8479986 to your computer and use it in GitHub Desktop.
<h1>Listing Classes</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th colspan=3></th>
</tr>
</thead>
<tbody>
<% @klasses.each do |klass| %>
<tr>
<td><%= klass.name %></td>
<td><%= link_to 'Show', klass %></td>
<td><%= link_to 'Edit', edit_klass_path(klass) %></td>
<td><%= link_to 'Destroy', klass, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to 'New Klass', new_klass_path %>
%h1 Listing Classes
%table
%thead
%tr
%th Name
%th{ colspan: 3 }
%tbody
- @klasses.each do |klass|
%tr
%td= klass.name
%td= link_to 'Show', klass
%td= link_to 'Edit', edit_klass_path(klass)
%td= link_to 'Destroy', klass, method: :delete, data: { confirm: 'Are you sure?' }
= link_to 'New Class', new_klass_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment