summaryrefslogtreecommitdiff
path: root/app/controllers/pager_group_destinations_controller.rb
blob: 655054a2e836cc3f4c7b510b72ecdd744d8aea8d (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 PagerGroupDestinationsController < ApplicationController
  def index
    @pager_group_destinations = PagerGroupDestination.all
  end

  def show
    @pager_group_destination = PagerGroupDestination.find(params[:id])
  end

  def new
    @pager_group_destination = PagerGroupDestination.new
  end

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

  def edit
    @pager_group_destination = PagerGroupDestination.find(params[:id])
  end

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

  def destroy
    @pager_group_destination = PagerGroupDestination.find(params[:id])
    @pager_group_destination.destroy
    redirect_to pager_group_destinations_url, :notice => t('pager_group_destinations.controller.successfuly_destroyed')
  end
end