Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Created January 5, 2017 21:44
Show Gist options
  • Save jordanhudgens/2023f69b3a16d13c86d57091eec39fe9 to your computer and use it in GitHub Desktop.
Save jordanhudgens/2023f69b3a16d13c86d57091eec39fe9 to your computer and use it in GitHub Desktop.
<h2><%= plural_table_name.titleize %></h2>
<p id="notice"><%%= notice %></p>
<hr>
<div>
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
<div class="content">
<% attributes.reject(&:password_digest?).each do |attribute| -%>
<p><%%= <%= singular_table_name %>.<%= attribute.name %> %></p>
<% end -%>
<p><%%= link_to 'Show', <%= singular_table_name %> %></p>
<p><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></p>
<p><%%= link_to 'Delete', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' } %></p>
</div>
<%% end %>
</div>
<br>
<%%= link_to 'Create a New <%= singular_table_name.titleize %>', new_<%= singular_table_name %>_path %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment