From what I've seen, most of the โgroupโ functions in Rails are built on the idea that there is a many-to-many relationship between users and groups. Groups hold many users as members, and users have membership in many groups. Thus, it is fairly simple to implement groups using has_many: through the relationships provided by ActiveRecord. Here is the simplest implementation:
class Group has_many :users, :through => :memberships end class User has_many :groups, :through => :memberships end class Membership belongs_to :group belongs_to :user end
Take a moment to look at the Rails tutorial, which discusses ActiveRecord associations, and you get an image.
I am sure that the Devise Invitable plug-in is used to invite someone to create a registration on your site, rather than inviting them to join a group on your site. I donโt know any gemstones that manage the group invitation system.
If groups are the main aspect of what you do with your site, you can look at some of the CMS options built on RoR. I think some of them have group management capabilities. Here is the resource: https://www.ruby-toolbox.com/categories/content_management_systems
Hope this helps.
source share