Class: Api::V1::ModelsController

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


30
31
32
33
# File 'app/controllers/api/v1/models_controller.rb', line 30

def create
  @model = Model.new(params[:model])
  process_response @model.save
end

#destroyObject


51
52
53
# File 'app/controllers/api/v1/models_controller.rb', line 51

def destroy
  process_response @model.destroy
end

#indexObject


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

def index
  @models = Model.search_for(*search_options).paginate(paginate_options)
end

#showObject


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

def show
end

#updateObject


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

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