Sha256: bd614bf23bfb6145e1fe38b45060bb046de0ea6d3e4e33118b42d540c07c43e5
Contents?: true
Size: 872 Bytes
Versions: 1
Compression:
Stored size: 872 Bytes
Contents
markup do |m| m.h1 'Listing <%= plural_table_name %>' m.table do m.thead do m.tr do <% attributes.each do |attribute| -%> m.th '<%= attribute.human_name %>' <% end -%> m.th m.th m.th end end m.tbody do @<%= plural_table_name %>.each do |<%= singular_table_name %>| m.tr do <% attributes.each do |attribute| -%> m.td '<%= singular_table_name %>.<%= attribute.name %>' <% end -%> m.td { m << link_to('Show', '<%= singular_table_name %>') } m.td { m << link_to('Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)) } m.td { m << link_to('Destroy', <%= singular_table_name %>, data: { confirm: 'Are you sure?' }, method: :delete) } end end end end m.br m << link_to('New <%= human_name %>', new_<%= singular_table_name %>_path) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
we_bridge-html_builder-0.1.7 | lib/generators/builder/scaffold/templates/index.html.builder |