Relative Content

Tag Archive for ruby-on-railsmodeldevise

how to make routes in rails for two models with three relationships

I am developing an application in rails in which I have two models: user and activity. user implements devise.
The situation is that a user can own several activities, can also be part of other activities created by other users, and can also see all the activities that have been created by all users.
My problem is that I want to be able to make an index method for each of these relationships, that is, to be able to apply resources for each type of relationship, but I don’t know how to do it. I had thought about things like namespace, module or scope, but these don’t really solve my problem, which is that I can only have one index method in my user controller.