Skip to content

Instantly share code, notes, and snippets.

@kethlinmil
Created March 7, 2017 12:19
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 kethlinmil/290de1e4570a2574c2602f6344f4dae6 to your computer and use it in GitHub Desktop.
Save kethlinmil/290de1e4570a2574c2602f6344f4dae6 to your computer and use it in GitHub Desktop.
<%= "<%= link_to 'Create new', new_#{singular_name}_path, class: 'btn btn-primary btn-sm mb-2' %%>" %>
<table class="table table-sm">
<tbody>
<%= "<% @#{plural_name}.each do |#{singular_name}| %%>" %>
<tr>
<td> <%= "<%= #{singular_name}.id %%>" %> </td>
<td> [ADD INFO] </td>
<td>
<% if show_action? -%>
<%= "<%= link_to 'Show', #{singular_name}_path(#{singular_name}), class: 'btn btn-sm btn-outline-info' %%>" %>
<% end -%>
<%= "<%= link_to 'Edit', edit_#{singular_name}_path(#{singular_name}), class: 'btn btn-sm btn-outline-info' %%>" %>
<%= "<%= link_to 'Destroy', #{singular_name}_path(#{singular_name}), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-outline-danger' %%>" %>
</td>
</tr>
<%= "<% end %%>" %>
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment