Class: ForemanPatch::PlansController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/foreman_patch/plans_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



14
15
16
# File 'app/controllers/foreman_patch/plans_controller.rb', line 14

def create
  @plan = Plan.new(plan_params)
end

#destroyObject



36
37
38
39
40
41
42
# File 'app/controllers/foreman_patch/plans_controller.rb', line 36

def destroy
  if @plan.destroy
    process_success success_hash
  else
    process_error
  end
end

#editObject



21
22
# File 'app/controllers/foreman_patch/plans_controller.rb', line 21

def edit
end

#indexObject



6
7
8
# File 'app/controllers/foreman_patch/plans_controller.rb', line 6

def index
  @plans = resource_base_search_and_page
end

#iterateObject



24
25
26
# File 'app/controllers/foreman_patch/plans_controller.rb', line 24

def iterate
  @plan.iterate
end

#newObject



10
11
12
# File 'app/controllers/foreman_patch/plans_controller.rb', line 10

def new
  @plan = Plan.new
end

#resource_classObject



44
45
46
# File 'app/controllers/foreman_patch/plans_controller.rb', line 44

def resource_class
  ForemanPatch::Plan
end

#showObject



18
19
# File 'app/controllers/foreman_patch/plans_controller.rb', line 18

def show
end

#updateObject



28
29
30
31
32
33
34
# File 'app/controllers/foreman_patch/plans_controller.rb', line 28

def update
  if @plan.update(plan_params)
    process_success success_hash
  else
    process_error
  end
end