Multi-tenant apps

1 view
Skip to first unread message

Chris Booth

unread,
Apr 14, 2009, 12:05:32 PM4/14/09
to Orlando Ruby Users Group Discussion
Has anyone come across any decent rails tutorials on how to set up
multi-tenant applications (other than the 2009 aac presentation)?
That presentation is great, but doesn't go into quite the depth I'm
looking for, specifically regarding using the URL/scoping method.

i.e. - using URLs like cbooth.myapp.com to determine the tenant and
scoping the data to only that tenant.

Or maybe I'm trying to out-think myself and making this too hard. Is
there a simply way to do this?

Thanks,

Chris

Jason Cartwright

unread,
Apr 14, 2009, 12:08:07 PM4/14/09
to orug-di...@googlegroups.com
There's a simple plugin from DHH called account_location (iirc) which I've adapted several times. Basically it uses the subdomain as the key for the current account. Then everything is scoped to the current_account. Obviously each application will have varying requirements, and I'd suggest performing a check to ensure the current user is authorized for the current account.

Jason

Chris

unread,
Apr 14, 2009, 12:44:05 PM4/14/09
to Orlando Ruby Users Group Discussion
Looks like exactly what I need. Thanks Jason!

-Chris

On Apr 14, 12:08 pm, Jason Cartwright <jasonecartwri...@gmail.com>
wrote:
> There's a simple plugin from DHH called account_location (iirc) which I've
> adapted several times. Basically it uses the subdomain as the key for the
> current account. Then everything is scoped to the current_account. Obviously
> each application will have varying requirements, and I'd suggest performing
> a check to ensure the current user is authorized for the current account.
>
> Jason
>

Jason Cartwright

unread,
Apr 14, 2009, 12:49:38 PM4/14/09
to orug-di...@googlegroups.com
Chris,

No problem. I recently adapted it for use on a platform we built called the Think808 Network in Hawaii. The client wanted to launch several Google Map/Review sites using separate domains. So we are not using subdomains, but actually running multiple domains on a single code base. It provides the same "multi-tenant" behavior, and will eventually aggregate into a shared social hub. You can check out http://ramen808.com to see what it does.

Let me know if you have any problems or questions.

Jason
Reply all
Reply to author
Forward
0 new messages