summaryrefslogtreecommitdiff
path: root/app/controllers/pager_groups_controller.rb
blob: 3b145b1fdb244f079f4ff0cb7afaf3e0713c656a (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
42
43
class PagerGroupsController < ApplicationController
  load_resource :sip_account
  load_resource :pager_group, :through => :sip_account

  def index
  end

  def show
    @pager_group = PagerGroup.find(params[:id])
  end

  def new
    @pager_group = PagerGroup.new
  end

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

  def edit
    @pager_group = PagerGroup.find(params[:id])
  end

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

  def destroy
    @pager_group = PagerGroup.find(params[:id])
    @pager_group.destroy
    redirect_to pager_groups_url, :notice => t('pager_groups.controller.successfuly_destroyed')
  end
end