The data for my application is structured as:
- Organizations have users
- Organizations have messages
- Organizations have sites
I would normally use nested resources to do this RESTfully:
resources :organizations do
resources :users
resources :messages
resources :sites
end
Which gives me URLs like:
/organizations/12/messages
/organizations/12/sites
These wordy URLs are excellent for when an admin needs to create a message for an organization because the URL contains the organization ID.
However, I would like to show normal users pretty URLs such as:
/messages
/sites
Is there a way to alias these pretty URLs to /organizations/{current_user.organization.id}/* ?