file 'lib/templates/erb/scaffold/_form.html.erb.tt', <<-CODE <%# frozen_string_literal: true %> <%%= simple_form_for(@<%= singular_table_name %>) do |f| %> <%%= f.error_notification %> <%%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
Id | <% attributes.each do |attribute| %><%= attribute.human_name %> | <% end %>Actions | <%%= link_to <%= singular_table_name %>.id, <%= singular_table_name %> %> | <% attributes.each do |attribute| %><%%= <%= singular_table_name %>.<%= attribute.name %> %> | <% end %><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'btn btn-sm btn-warning' %> <%%= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' %> | <%% end %> <%% end %>
---|