You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 changing to_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.
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: