diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-17 12:01:45 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-17 12:01:45 +0100 |
commit | b80bd744ad873f6fc43018bc4bfb90677de167bd (patch) | |
tree | 072c4b0e33d442528555b82c415f5e7a1712b2b0 /app/controllers/sip_domains_controller.rb | |
parent | 3e706c2025ecc5523e81ad649639ef2ff75e7bac (diff) |
Start of GS5.
Diffstat (limited to 'app/controllers/sip_domains_controller.rb')
-rw-r--r-- | app/controllers/sip_domains_controller.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/controllers/sip_domains_controller.rb b/app/controllers/sip_domains_controller.rb new file mode 100644 index 0000000..7301192 --- /dev/null +++ b/app/controllers/sip_domains_controller.rb @@ -0,0 +1,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 |