Class: Api::V1::UsergroupsController

Inherits:
BaseController show all
Defined in:
app/controllers/api/v1/usergroups_controller.rb

Instance Method Summary collapse

Methods included from Api::Version1

#api_version

Methods inherited from BaseController

#get_resource, #resource_class, #resource_name, #resource_scope

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#createObject


27
28
29
30
# File 'app/controllers/api/v1/usergroups_controller.rb', line 27

def create
  @usergroup = Usergroup.new(params[:usergroup])
  process_response @usergroup.save
end

#destroyObject


45
46
47
# File 'app/controllers/api/v1/usergroups_controller.rb', line 45

def destroy
  process_response @usergroup.destroy
end

#indexObject


12
13
14
# File 'app/controllers/api/v1/usergroups_controller.rb', line 12

def index
  @usergroups = Usergroup.search_for(*search_options).paginate(paginate_options)
end

#showObject


19
20
# File 'app/controllers/api/v1/usergroups_controller.rb', line 19

def show
end

#updateObject


38
39
40
# File 'app/controllers/api/v1/usergroups_controller.rb', line 38

def update
  process_response @usergroup.update_attributes(params[:usergroup])
end