getting_started_controller.rb 398 B

123456789101112131415161718192021
  1. class GettingStartedController < ApplicationController
  2. def index
  3. # check if first user already exists
  4. master_user = 0
  5. count = User.all.count()
  6. if count == 1
  7. master_user = 1
  8. end
  9. # get all groups
  10. @groups = Group.where( :active => true )
  11. # return result
  12. render :json => {
  13. :master_user => master_user,
  14. :groups => @groups,
  15. }
  16. end
  17. end