Class: CommonParametersController

Inherits:
ApplicationController show all
Includes:
Foreman::Controller::AutoCompleteSearch
Defined in:
app/controllers/common_parameters_controller.rb

Instance Method Summary collapse

Methods included from Foreman::Controller::AutoCompleteSearch

#auto_complete_search, #invalid_search_query

Methods inherited from ApplicationController

#api_request?, #welcome

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#createObject


16
17
18
19
20
21
22
23
# File 'app/controllers/common_parameters_controller.rb', line 16

def create
  @common_parameter = CommonParameter.new(params[:common_parameter])
  if @common_parameter.save
    process_success
  else
    process_error
  end
end

#destroyObject


38
39
40
41
42
43
44
45
# File 'app/controllers/common_parameters_controller.rb', line 38

def destroy
  @common_parameter = CommonParameter.find(params[:id])
  if @common_parameter.destroy
    process_success
  else
    process_error
  end
end

#editObject


25
26
27
# File 'app/controllers/common_parameters_controller.rb', line 25

def edit
  @common_parameter = CommonParameter.find(params[:id])
end

#indexObject


4
5
6
7
8
9
10
# File 'app/controllers/common_parameters_controller.rb', line 4

def index
  values = CommonParameter.search_for(params[:search], :order => params[:order])
  respond_to do |format|
    format.html { @common_parameters = values.paginate(:page => params[:page]) }
    format.json { render :json => values}
  end
end

#newObject


12
13
14
# File 'app/controllers/common_parameters_controller.rb', line 12

def new
  @common_parameter = CommonParameter.new
end

#updateObject


29
30
31
32
33
34
35
36
# File 'app/controllers/common_parameters_controller.rb', line 29

def update
  @common_parameter = CommonParameter.find(params[:id])
  if @common_parameter.update_attributes(params[:common_parameter])
    process_success
  else
    process_error
  end
end