Sha256: 33b83025260da6f8458d247f87ca23269c37a4cc5ba2ae265052a498f2add7ca
Contents?: true
Size: 1.7 KB
Versions: 5
Compression:
Stored size: 1.7 KB
Contents
<h2><%%= t('headers.index', name: t('activerecord.models.<%= singular_table_name %>.other')) %></h2> <table class="table table-striped table-hover"> <thead> <tr> <% attributes.each do |attribute| -%> <th><%%= t('activerecord.attributes.<%= singular_table_name %>.<%= attribute.name %>') %></th> <% end -%> <th class="index-actions"><%%= t('actions.title') %></th> </tr> </thead> <tbody> <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> <tr> <% attributes.each do |attribute| -%> <td> <%- if attribute.name.include?("picture") -%> <%%= image_tag(<%= singular_table_name %>.<%= attribute.name %>_url(:thumb).to_s) %> <%- elsif attribute.type == :boolean -%> <%%= <%= singular_table_name %>.<%= attribute.name %> ? t('simple_form.yes') : t('simple_form.no') %> <%- elsif attribute.type == :belongs_to -%> <%%= <%= singular_table_name %>.<%= attribute.name %>.name %> <%- else -%> <%%= <%= singular_table_name %>.<%= attribute.name %> %> <%- end -%> </td> <% end -%> <td> <%%= link_to t('actions.show'), <%= singular_table_name %>, class: 'btn btn-default btn-xs' %> <br> <%%= link_to t('actions.edit'), [:edit, <%= singular_table_name %>], class: 'btn btn-default btn-xs' %> <br> <%%= link_to t('actions.destroy'), <%= singular_table_name %>, method: :delete, data: { confirm: t('actions.confirm') }, class: 'btn btn-danger btn-xs' %> </td> </tr> <%% end %> </tbody> </table> <br> <%%= link_to t('actions.add', name: t('activerecord.models.<%= singular_table_name %>.one')), new_<%= singular_table_name %>_path, class: 'btn btn-primary' %>
Version data entries
5 entries across 5 versions & 1 rubygems