Class: Api::V1::RolesController

Inherits:
BaseController show all
Defined in:
app/controllers/api/v1/roles_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


26
27
28
29
# File 'app/controllers/api/v1/roles_controller.rb', line 26

def create
  @role = Role.new(params[:role])
  process_response @role.save
end

#destroyObject


44
45
46
# File 'app/controllers/api/v1/roles_controller.rb', line 44

def destroy
  process_response @role.destroy
end

#indexObject


11
12
13
# File 'app/controllers/api/v1/roles_controller.rb', line 11

def index
  @roles = Role.search_for(*search_options).paginate(paginate_options)
end

#showObject


18
19
# File 'app/controllers/api/v1/roles_controller.rb', line 18

def show
end

#updateObject


37
38
39
# File 'app/controllers/api/v1/roles_controller.rb', line 37

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