I’m trying create a form to insert new Links that belongs to an Organization.
On my application, every Organization means a Tenant, as I’m learning how to create multitenancy application using foreing keys. Here is my tables’ diagram:
At the end, what I’m trying to create is something related to the Flyio’s dashboard where we are able to switch between different Organizations (tenants) and from each Organization, insert new items (in my case, the Links).
Here is my Organization index
page:
path /organizations
The Organization show
page where I can create a New Link:
path /organizations/01
And the New Link page.
path /organizations/01/links/new
The router for this page is set this way
get "/organizations/:organization_id/links", LinkController, :create
At this point, I would like to insert the organization_id
on the links schema and fill the proper column.
I’ve being trying to achieve it reading the documentation and some tutorials but at this point haven’t success.
Any help would be greatly appreciated.