https://avo.cool logo
Multi tenancy
# general
r
I'm trying to use Avo in a multi-tenancy setup, and need to associate models with the tenant model on the create action. What's the recommended way to do this?
l
Hello @rough-student-26326 , he have this documentation page about multi tenancy https://docs.avohq.io/2.0/recipes/multitenancy.html#use-route-level-multitenancy. Also there is the community help section on this discord where folks usually ask and discuss questions like this one.
l
and to associate the record on creation with the current tenant you should add a
hidden
field with the value already prefilled
Copy code
ruby
# in your resource file
field :user_id, as: :hidden do
  Current.user # or current_user
end
Hey @rough-student-26326. In order to provide make the support process easier on us and you we have specialized channels such as #1141725718364045394 #1141725736386973768 #1141725787020603493 and more general support ones like #740893011994738751 and #1138182212655788054