-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Add a slug
type field partial?
#1232
Open
jagthedrummer opened this issue
Dec 6, 2023
· 2 comments
· May be fixed by bullet-train-co/bullet_train-core#764
Open
Add a slug
type field partial?
#1232
jagthedrummer opened this issue
Dec 6, 2023
· 2 comments
· May be fixed by bullet-train-co/bullet_train-core#764
Comments
I feel this should be packaged into the A slug is also a way to obfuscate the id, and |
Ooooh, that's a good connection, @pascallaliberte! I think you're absolutely right on that. |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes models need to have a user-settable url slug, and it might be nice to have this built in to BT.
For instance, if the
Team
model had a slug you might be able to view a team at/teams/my-team
instead of at/teams/a39bc12
.It's kind of just a
text_field
with some additional requirements and validations (like uniqueness, for example), but there's also the matter of looking up models by slug instead of by id/obfuscated-id, which can be solved by changingto_param
.Maybe this is more application specific than generic and wouldn't be a good addition to BT. Just wanted to throw it out there and see what other people think.
Here's an article that talks about lots of the specific details that we'd need to address if we wanted to do something: https://nts.strzibny.name/activerecord-model-slugs/
The text was updated successfully, but these errors were encountered: