Class: ForemanPatch::WindowPlansController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  @window_plan = WindowPlan.new(window_plan_params)
end

#destroyObject



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

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

#editObject



16
17
18
# File 'app/controllers/foreman_patch/window_plans_controller.rb', line 16

def edit
  @plan = @window_plan.plan
end

#newObject



8
9
10
# File 'app/controllers/foreman_patch/window_plans_controller.rb', line 8

def new
  @window_plan = WindowPlan.new
end

#resource_classObject



36
37
38
# File 'app/controllers/foreman_patch/window_plans_controller.rb', line 36

def resource_class
  ForemanPatch::WindowPlan
end

#updateObject



20
21
22
23
24
25
26
# File 'app/controllers/foreman_patch/window_plans_controller.rb', line 20

def update
  if @window_plan.update(window_plan_params)
    process_success success_hash
  else
    process_error
  end
end