Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the index a table again #457

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

patriciomacadden
Copy link
Contributor

As per this PR, the scaffold generator stopped generating a table in the index page, and encourages css frameworks gems (such as this) to do the styling.

I don't quite like what the generator generates currently (design wise, although I'm no designer), so I thought of bringing back the table, with a basic style so it's ready to use (or as ready to use as possible).

I looked for box-style CRUD designs so we could keep using the partial but I couldn't find anything.

As always, before and after pictures:

before after
image image

Comment on lines +26 to +33
<tr class="border-b">
<% attributes.reject(&:password_digest?).each do |attribute| -%>
<td class="py-4 whitespace-nowrap"><%%= <%= singular_name %>.<%= attribute.column_name %> %></td>
<% end -%>
<td class="py-4 space-x-4 whitespace-nowrap">
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "text-blue-600 hover:text-blue-900" %>
</td>
</tr>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can still have this in a partial but i don't see the benefit - i don't think it'll be used somewhere else.

<td class="py-4 whitespace-nowrap"><%%= <%= singular_name %>.<%= attribute.column_name %> %></td>
<% end -%>
<td class="py-4 space-x-4 whitespace-nowrap">
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "text-blue-600 hover:text-blue-900" %>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept just the link to the show action, but we can also add the Edit and Destroy links. thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant