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

index: show the actions to the right of the partial and add a division #461

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

patriciomacadden
Copy link
Contributor

between objects.

Currently, when your collection has many objects, and given the "show this xxx" button is grey, it's hard to distinguish when an object ends and another one begins.

This PR adds a subtle division between objects and wraps the partial in a flex item, moving the show button to the right hand side. Also, as suggested in #457 , I've added the edit and destroy buttons.

before after
image image

@flavorjones
Copy link
Member

Because tailwind v4 just shipped, I'm going to hold off until this gem properly supports it, then we can make sure this PR is styled appropriately for v4.

@patriciomacadden
Copy link
Contributor Author

just rebased so it fixes the conflict

@flavorjones
Copy link
Member

Will take a look at this and your other style updates in the next day or so! Thanks for your patience.

@patriciomacadden
Copy link
Contributor Author

@flavorjones can i do something to help out with reviews? maybe merging all the open PRs (re styling) into a single one for easier review?

@flavorjones
Copy link
Member

I've just been under water the last few weeks. Will get to these today.

@patriciomacadden
Copy link
Contributor Author

no rush, i was just wondering if there was anything I could do to help out. didn't want to push, apologies if it felt that way!

Copy link
Member

@flavorjones flavorjones left a comment

Choose a reason for hiding this comment

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

Added a simplifying commit but otherwise this is great! Thank you!

<%%= render <%= singular_table_name %> %>
<div class="space-x-2">
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%%= link_to "Edit", edit_<%= singular_route_name %>_path(<%= singular_table_name %>), class: "rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
Copy link
Member

Choose a reason for hiding this comment

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

I've added a commit simplifying this to use edit_helper.

@flavorjones flavorjones merged commit 28ec1c8 into rails:main Feb 19, 2025
17 checks passed
@patriciomacadden
Copy link
Contributor Author

oh, great, thank you! :)

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.

2 participants