Class: Fae::DeployHooksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/fae/deploy_hooks_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/fae/deploy_hooks_controller.rb', line 19

def create
  @deploy_hook = DeployHook.new(deploy_hook_params)

  if @deploy_hook.save
    flash[:notice] = t('fae.save_notice')
    @deploy_hooks = DeployHook.all
    render template: table_template_path
  else
    render action: 'new'
  end
end

#destroyObject



41
42
43
44
45
46
47
48
49
# File 'app/controllers/fae/deploy_hooks_controller.rb', line 41

def destroy
  if @deploy_hook.destroy
    flash[:notice] = t('fae.delete_notice')
  else
    flash[:alert] = t('fae.delete_error')
  end
  @deploy_hooks = DeployHook.all
  render template: table_template_path
end

#editObject



16
17
# File 'app/controllers/fae/deploy_hooks_controller.rb', line 16

def edit
end

#indexObject



8
9
10
# File 'app/controllers/fae/deploy_hooks_controller.rb', line 8

def index
  @deploy_hooks = DeployHook.all
end

#newObject



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

def new
  @deploy_hook = DeployHook.new
end

#updateObject



31
32
33
34
35
36
37
38
39
# File 'app/controllers/fae/deploy_hooks_controller.rb', line 31

def update
  if @deploy_hook.update(deploy_hook_params)
    flash[:notice] = t('fae.save_notice')
    @deploy_hooks = DeployHook.all
    render template: table_template_path
  else
    render action: 'edit'
  end
end