# Accounts with multiple users and routing

**URL:** <https://www.ruby-forum.com/t/accounts-with-multiple-users-and-routing/119371>\
**Category:** Rails\
**Created:** [November 6, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/accounts-with-multiple-users-and-routing/119371 "2007-11-06T14:07:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmlk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@gmlk](https://www.ruby-forum.com/u/gmlk)\
**Post date:** [November 6, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/accounts-with-multiple-users-and-routing/119371/1 "2007-11-06T14:07:35Z")

</div>

I’m building an application where a person/group can make an account  
and then create users within this account. The idear is to store al  
the data with a :account\_id so that users can only see the data which  
belongs to their account.

Now I wanted to create the following url layout:

hxxp://hostname.tld/:account/:action/:id

So if Alice starts an account with the name “asdf” she would login on

hxxp://hostname.tld/asdf/login

(hxxp://hostname.tld would contain the signup page.)

My question: What would be the best way to realize this layout?
