Sha256: 7c05b1cde591d2369c5c539e9ea6862d9573f55971d575c6f787d841b5b79a53

Contents?: true

Size: 854 Bytes

Versions: 3

Compression:

Stored size: 854 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 << link_to('Show', '<%= singular_table_name %>')
        m.td << link_to('Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>))
        m.td << 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

3 entries across 3 versions & 1 rubygems

Version Path
we_bridge-html_builder-0.1.6 lib/generators/builder/scaffold/templates/index.html.builder
we_bridge-html_builder-0.1.5 lib/generators/builder/scaffold/templates/index.html.builder
we_bridge-html_builder-0.1.4 lib/generators/builder/scaffold/templates/index.html.builder