diff --git a/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt b/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt index 7c44d03..7ea5485 100644 --- a/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt +++ b/lib/generators/tailwindcss/scaffold/templates/index.html.erb.tt @@ -2,11 +2,11 @@
<%% if notice.present? %> -

<%%= notice %>

+

<%%= notice %>

<%% end %> -
-

<%= human_name.pluralize %>

+
+

<%= human_name.pluralize %>

<%%= link_to "New <%= human_name.downcase %>", new_<%= singular_route_name %>_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
@@ -22,20 +22,34 @@ - <%% @users.each do |user| %> + <%% @<%= plural_table_name %>.each do |<%= singular_name %>| %> <% attributes.reject(&:password_digest?).each do |attribute| -%> +<% if attribute.attachment? -%> + <%%= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %> if <%= singular_name %>.<%= attribute.column_name %>.attached? %> +<% elsif attribute.attachments? -%> + + <%% <%= singular_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %> +
<%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %>
+ <%% end %> + +<% else -%> <%%= <%= singular_name %>.<%= attribute.column_name %> %> +<% end -%> <% end -%> <%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "text-blue-600 hover:text-blue-900" %> + <%%= link_to "Edit", edit_<%= singular_route_name %>_path(<%= singular_table_name %>), class: "text-blue-600 hover:text-blue-900" %> +
+ <%%= button_to "Destroy", <%= model_resource_name %>, method: :delete, class: "text-red-600 hover:text-red-900" %> +
<%% end %> <%% else %> -

No <%= human_name.downcase.pluralize %> found.

+

No <%= human_name.downcase.pluralize %> found.

<%% end %>