Class: Api::V1::PtablesController

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


29
30
31
32
# File 'app/controllers/api/v1/ptables_controller.rb', line 29

def create
  @ptable = Ptable.new(params[:ptable])
  process_response @ptable.save
end

#destroyObject


49
50
51
# File 'app/controllers/api/v1/ptables_controller.rb', line 49

def destroy
  process_response @ptable.destroy
end

#indexObject


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

def index
  @ptables = Ptable.search_for(*search_options).paginate(paginate_options)
end

#showObject


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

def show
end

#updateObject


42
43
44
# File 'app/controllers/api/v1/ptables_controller.rb', line 42

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