summaryrefslogtreecommitdiff
path: root/app/controllers/sip_domains_controller.rb
blob: 73011921f57d00254ce5429be2bf70784eead2d3 (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 SipDomainsController < ApplicationController
  def index
    @sip_domains = SipDomain.all
  end

  def show
    @sip_domain = SipDomain.find(params[:id])
  end

  def new
    @sip_domain = SipDomain.new
  end

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

  def edit
    @sip_domain = SipDomain.find(params[:id])
  end

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

  def destroy
    @sip_domain = SipDomain.find(params[:id])
    @sip_domain.destroy
    redirect_to sip_domains_url, :notice => t('sip_domains.controller.successfuly_destroyed')
  end
end