lib/generators/nice/install/templates/slim/index.html.slim
h1 = title t('views.<%= plural_table_name %>.index')
- if @<%= plural_table_name %>.any?
table
tr
<% attributes.each do |attribute| -%>
th =t 'activerecord.attributes.<%= singular_table_name %>.<%= attribute.name %>'
<% end -%>
th
th
th
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
tr
<% attributes.each do |attribute| -%>
td = <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
td = link_to t('nice.show'), <%= singular_table_name %>
td = link_to t('nice.edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
td = link_to t('nice.destroy'), <%= singular_table_name %>, confirm: t('nice.are_you_sure'), method: :delete
- else
=t 'views.<%= plural_table_name %>.empty'
br
= link_to t('views.<%= plural_table_name %>.new'), new_<%= singular_table_name %>_path