<%%= link_to '添加 <%= human_name %>
'.html_safe, new_<%= singular_table_name %>_path, class: "btn btn-sm green" %>
<% attributes.reject(&:password_digest?).each do |attribute| -%>
<%= attribute.human_name %> |
<% end -%>
|
<%%= form_tag <%= index_helper %>_path, method: :get do %>
<% attributes.each do |attribute| -%>
<%%= <%= attribute.field_type %>_tag :<%= attribute.column_name %>, (params[:<%= attribute.column_name %>].blank? ? '' : params[:<%= attribute.column_name %>]), class: "form-control form-filter input-sm", placeholder: "<%= attribute.column_name %>" %>
|
<% end -%>
|
<%% end %>
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
<% attributes.reject(&:password_digest?).each do |attribute| -%>
<%%= <%= singular_table_name %>.<%= attribute.name %> %> |
<% end -%>
<%%= link_to '查看', <%= singular_table_name %> %> |
<%%= link_to '修改', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %> |
<%%= link_to '删除', <%= singular_table_name %>, method: :delete, data: { confirm: '你确定要删除么?' } %> |
<%% end %>
<%%= paginate @<%= plural_table_name %> %>