initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
- model_class = <%= resource_name.classify %>
|
||||
div.page-header= title :index, model_class
|
||||
- if @<%= plural_resource_name %>.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
<%- columns.each do |column| -%>
|
||||
th= model_class.human_attribute_name(:<%= column.name %>)
|
||||
<%- end -%>
|
||||
<%- belongs_to_associations.each do |association| -%>
|
||||
th= <%= association.options[:class_name] %>.model_name.human
|
||||
<%- end -%>
|
||||
th= model_class.human_attribute_name(:created_at)
|
||||
th=t 'helpers.actions'
|
||||
tbody
|
||||
- @<%= plural_resource_name %>.each do |<%= resource_name %>|
|
||||
tr
|
||||
<%- columns.each.with_index do |column, index| -%>
|
||||
<%- if index.zero? -%>
|
||||
td= link_to <%= resource_name %>.<%= column.name %>, <%= resource_name %>
|
||||
<%- else -%>
|
||||
td= <%= resource_name %>.<%= column.name %>
|
||||
<%- end end -%>
|
||||
<%- belongs_to_associations.each do |association| -%>
|
||||
td= link_to <%= resource_name %>.<%= association.name %>.<%= association.name_property %>, <%= resource_name %>.<%= association.name %>
|
||||
<%- end -%>
|
||||
td=l <%= resource_name %>.created_at, format: :short
|
||||
td
|
||||
= link_to t('helpers.links.edit'), [:edit, <%= resource_name %>], class: 'btn btn-mini'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), <%= resource_name %>, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
||||
- else
|
||||
= no_content_given model_class
|
||||
= link_to t("helpers.links.new"), new_<%= singular_controller_routing_path %>_path, class: 'btn btn-primary'
|
||||
|
||||
Reference in New Issue
Block a user