Class: Api::V2::ParametersController

Inherits:
BaseController show all
Includes:
TaxonomyScope, Api::Version2
Defined in:
app/controllers/api/v2/parameters_controller.rb

Instance Method Summary collapse

Methods included from TaxonomyScope

#set_taxonomy_scope

Methods included from Api::Version2

#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


61
62
63
64
# File 'app/controllers/api/v2/parameters_controller.rb', line 61

def create
  @parameter = nested_obj.send(parameters_method).new(params[:parameter])
  process_response @parameter.save
end

#destroyObject


94
95
96
# File 'app/controllers/api/v2/parameters_controller.rb', line 94

def destroy
  process_response @parameter.destroy
end

#indexObject


30
31
32
# File 'app/controllers/api/v2/parameters_controller.rb', line 30

def index
  @parameters = nested_obj.send(parameters_method).paginate(paginate_options)
end

#resetObject


103
104
105
106
# File 'app/controllers/api/v2/parameters_controller.rb', line 103

def reset
  @parameter = nested_obj.send(parameters_method)
  process_response @parameter.destroy_all
end

#showObject


44
45
# File 'app/controllers/api/v2/parameters_controller.rb', line 44

def show
end

#updateObject


80
81
82
# File 'app/controllers/api/v2/parameters_controller.rb', line 80

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