App with Users and Organizations, how should I structure my models?

Hello Upcase People!

First post here : ) I’d really appreciate some help. I’m currently building an application where I have Users, Organizations, and Projects.
I want my URIs to be like Github’s, in the sense that you can have:

application.com/john-doe
and
application.com/johns-organization

Both of them can create projects: application.com/john-doe/secret-project

I’m unsure about what’s the best way to structure my Users and Organizations models to accomplish this. I was advised against doing Single Table Inheritance.

Note: I am using Friendly ID for the URLs.

Interesting problem! Here’s an old post I found that might point you in the right direction: Pretty, short urls for every route in your Rails app | Arkency Blog

1 Like

Thanks for that @dstrunk. It has turned out to be really helpful!