0.0
The project is in a healthy, maintained state
SimpleTeams is an all-in-one solution for implementing teams quickly in a Ruby on Rails (RoR) application. It follows best practices, using the Rails Engine design pattern for easy configurability, CanCan for authorization, and polymorphic association (like ActiveStorage) to avoid dictating model names.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 3.5.0
~> 4.8.1
~> 2.4.1
~> 5.1.0
>= 7.0.7.2
 Project Readme

SimpleTeams

SimpleTeams is an all-in-one solution for implementing teams quickly in a Ruby on Rails (RoR) application. It follows best practices, using the Rails Engine design pattern for easy configurability, CanCan for authorization, and polymorphic association (like ActiveStorage) to avoid dictating model names.

STATUS

SimpleTeams is in use within several client-facing applications. However, the gem is still under development, and notably lacks standalone testing.

That said, feel free to try it out, and let us know if you have any comments/questions. Just make sure to test things thoroughly, and be patient with the (sparse) documentation.

Installation

  1. Add simple_teams to your Gemfile and run bundle install

  2. Add the necessary initializers to your config directory (NEED TO ADD DETAILS)

  • devise.rb (see devise gem for further details)

  • simple_form.rb (see simple_form gem for further details)

  • simple_teams.rb (NEED TO MAKE THIS AN INSTALL SCRIPT)

  1. Install the necessary migrations for simple_teams and it's dependencies
devise generate User
rails noticed:install:migrations
rails simple_teams:install:migrations
  1. Add the SimpleTeams concerns to the desired models. E.g.
#app/models/user.rb
class User
  include SimpleTeams::MemberObject
...

#app/models/Organization.rb
class Organization
  include SimpleTeams::TeamObject
...
  1. Make sure to initialize the TeamObject properly via the InitializeTeamService to specify the owner of the team. E.g.
#within the create action of app/controllers/organizations_controller.rb

def create
  if @organization.update(organization_params)
    SimpleTeams::InitializeTeamService.new(current_user, @organization.team).perform
    redirect_to @organization, ...
...

Usage

  1. SimpleTeams comes pre-packaged with all of the necessary controllers and views for adding/updating/removing team members. For the default functionality, you can simply link from the teamable object (e.g. the "Organization") to the team for users to view/manage these permissions. E.g.
#app/views/organizations/show.html.erb

link_to "Organization Roles", simple_teams.team_path(@organization.team)

  1. The breadcrumbs in these views will reference the default routes for the teamable resource automatically. E.g. Organizations / Test Organization / Team Members

However, you can customize these views, as well, by installing them in your application via the standard Engine functionality (i.e. "rails simple_teams:install:views")

  1. NOTE: NEED TO ADD INSTRUCTIONS REGARDING locale configuration.

Contributing

This gem is still in its initial stages, so it is important to ensure that it grows in the proper directions.

That said, contributions are welcome, but please give me a heads up on your ideas (via Github issues) so that we can discuss them beforehand.

License

The gem is available as open source under the terms of the MIT License.