Class: GoodJob::PausesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/good_job/pauses_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
15
16
# File 'app/controllers/good_job/pauses_controller.rb', line 10

def create
  pause_type = params[:type].to_sym
  pause_value = params[:value].to_s

  GoodJob::Setting.pause(pause_type => pause_value)
  redirect_to({ action: :index }, notice: "Successfully paused #{params[:type]} '#{params[:value]}'")
end

#destroyObject



18
19
20
21
22
23
24
# File 'app/controllers/good_job/pauses_controller.rb', line 18

def destroy
  pause_type = params[:type].to_sym
  pause_value = params[:value].to_s

  GoodJob::Setting.unpause(pause_type => pause_value)
  redirect_to({ action: :index }, notice: "Successfully unpaused #{params[:type]} '#{params[:value]}'")
end

#indexObject



6
7
8
# File 'app/controllers/good_job/pauses_controller.rb', line 6

def index
  @paused = GoodJob::Setting.paused
end