Class: Api::V1::LookupKeysController

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


34
35
36
37
# File 'app/controllers/api/v1/lookup_keys_controller.rb', line 34

def create
  @lookup_key = LookupKey.new(params[:lookup_key])
  process_response @lookup_key.save
end

#destroyObject


57
58
59
# File 'app/controllers/api/v1/lookup_keys_controller.rb', line 57

def destroy
  process_response @lookup_key.destroy
end

#indexObject


14
15
16
# File 'app/controllers/api/v1/lookup_keys_controller.rb', line 14

def index
  @lookup_keys = LookupKey.search_for(*search_options).paginate(paginate_options)
end

#showObject


21
22
# File 'app/controllers/api/v1/lookup_keys_controller.rb', line 21

def show
end

#updateObject


50
51
52
# File 'app/controllers/api/v1/lookup_keys_controller.rb', line 50

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