Sprankelprachtig aan/afmeldsysteem

groups_controller.rb 481B

12345678910111213141516171819202122
  1. class Api::GroupsController < ApiController
  2. before_action :set_group, only: [:show]
  3. before_action :require_membership!, only: [:show]
  4. before_action :api_require_admin!, only: [:index]
  5. # GET /api/groups
  6. # GET /api/groups.json
  7. def index
  8. @api_groups = Api::Group.all
  9. end
  10. # GET /api/groups/1
  11. def show
  12. end
  13. private
  14. # Use callbacks to share common setup or constraints between actions.
  15. def set_group
  16. @group = Group.find(params[:id])
  17. end
  18. end