summaryrefslogtreecommitdiff
path: root/app/controllers/acd_callers_controller.rb
blob: ab58064eb399caf71296b4312e66bef2be8b78f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class AcdCallersController < ApplicationController
  def index
    @acd_callers = AcdCaller.all
  end

  def show
    @acd_caller = AcdCaller.find(params[:id])
  end

  def new
    @acd_caller = AcdCaller.new
  end

  def create
    @acd_caller = AcdCaller.new(params[:acd_caller])
    if @acd_caller.save
      redirect_to @acd_caller, :notice => t('acd_callers.controller.successfuly_created')
    else
      render :new
    end
  end

  def edit
    @acd_caller = AcdCaller.find(params[:id])
  end

  def update
    @acd_caller = AcdCaller.find(params[:id])
    if @acd_caller.update_attributes(params[:acd_caller])
      redirect_to @acd_caller, :notice  => t('acd_callers.controller.successfuly_updated')
    else
      render :edit
    end
  end

  def destroy
    @acd_caller = AcdCaller.find(params[:id])
    @acd_caller.destroy
    redirect_to acd_callers_url, :notice => t('acd_callers.controller.successfuly_destroyed')
  end
end