Class: WebhooksController

Inherits:
ApplicationController
  • Object
show all
Includes:
Foreman::Controller::AutoCompleteSearch, ForemanWebhooks::Controller::Parameters::Webhook
Defined in:
app/controllers/webhooks_controller.rb

Instance Method Summary collapse

Methods included from ForemanWebhooks::Controller::Parameters::Webhook

#webhook_params

Instance Method Details

#createObject



13
14
15
16
17
18
19
20
# File 'app/controllers/webhooks_controller.rb', line 13

def create
  @webhook = Webhook.new(webhook_params)
  if @webhook.save
    process_success success_redirect: '/webhooks'
  else
    process_error
  end
end

#destroyObject



32
33
34
35
36
37
38
# File 'app/controllers/webhooks_controller.rb', line 32

def destroy
  if @webhook.destroy
    process_success
  else
    process_error
  end
end

#editObject



22
# File 'app/controllers/webhooks_controller.rb', line 22

def edit; end

#newObject



9
10
11
# File 'app/controllers/webhooks_controller.rb', line 9

def new
  @webhook = Webhook.new
end

#updateObject



24
25
26
27
28
29
30
# File 'app/controllers/webhooks_controller.rb', line 24

def update
  if @webhook.update(webhook_params)
    process_success success_redirect: '/webhooks'
  else
    process_error
  end
end