summaryrefslogtreecommitdiff
path: root/app/controllers/api/v1
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-04 15:53:09 +0200
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-04 15:53:09 +0200
commit98e9aa73e258391bd2eaf935cf00d91d91546801 (patch)
tree522ec0557303e256e7bb8aca25dbb689055a5a26 /app/controllers/api/v1
parent7a5a635a93e0803569d1107d2a64cfaa081d6743 (diff)
Added destroy to the API
Diffstat (limited to 'app/controllers/api/v1')
-rw-r--r--app/controllers/api/v1/pager_groups_controller.rb25
1 files changed, 5 insertions, 20 deletions
diff --git a/app/controllers/api/v1/pager_groups_controller.rb b/app/controllers/api/v1/pager_groups_controller.rb
index 468a6aa..753e938 100644
--- a/app/controllers/api/v1/pager_groups_controller.rb
+++ b/app/controllers/api/v1/pager_groups_controller.rb
@@ -1,24 +1,16 @@
module Api
module V1
class PagerGroupsController < ApplicationController
- respond_to :json
-
skip_before_filter :verify_authenticity_token
+ respond_to :json
def index
- # if params[:ids]
- # @sip_accounts = SipAccount.where(:id => params[:ids])
- # else
- # @sip_accounts = SipAccount.all
- # end
@pager_groups = PagerGroup.all
-
respond_with @pager_groups
end
def show
@pager_group = PagerGroup.find(params[:id])
-
respond_with @pager_group
end
@@ -34,19 +26,12 @@ module Api
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 destroy
@pager_group = PagerGroup.find(params[:id])
- @pager_group.destroy
- respond_with nil
+ if @pager_group
+ @pager_group.destroy
+ respond_with @pager_group
+ end
end
end