Reputation: 882
I am building a team management app in Rails where :users
has many :organizations
. I would like for users to be able to switch between organisations and manage them individually without having the /organizations/:id/
in the URL. Due to Wildcard SSL certificate costs, I would also like to avoid using subdomains to identify the organization.
As I understand it, this leaves two options:
What would be the best option here?
Thanks
Upvotes: 0
Views: 47
Reputation: 3031
Simply store it in the session, there's no reason to do it any other way. I would also create a before_action in the application controller to automatically load the organization into an instance variable available to your controllers and views.
Upvotes: 2