diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-06-20 19:06:19 +0200 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-06-20 19:06:19 +0200 |
commit | eb0e1cc5c26275ff3e5c341404e8bc558f8312b8 (patch) | |
tree | 71f449ccd6f15422717de3ac24f87d5e888ddd79 /app/controllers/api/v1/pager_groups_controller.rb | |
parent | df6e17e48995f25e72509986f30700d778b179b6 (diff) | |
parent | 3b27a5d45b12f6bac65da2a8e17387bfda42a2f1 (diff) |
Merge branch 'develop'
Diffstat (limited to 'app/controllers/api/v1/pager_groups_controller.rb')
-rw-r--r-- | app/controllers/api/v1/pager_groups_controller.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/app/controllers/api/v1/pager_groups_controller.rb b/app/controllers/api/v1/pager_groups_controller.rb new file mode 100644 index 0000000..753e938 --- /dev/null +++ b/app/controllers/api/v1/pager_groups_controller.rb @@ -0,0 +1,39 @@ +module Api + module V1 + class PagerGroupsController < ApplicationController + skip_before_filter :verify_authenticity_token + respond_to :json + + def index + @pager_groups = PagerGroup.all + respond_with @pager_groups + end + + def show + @pager_group = PagerGroup.find(params[:id]) + respond_with @pager_group + end + + def new + if params[:sip_account_id] && SipAccount.find(params[:sip_account_id]) + @pager_group = SipAccount.find(params[:sip_account_id]).pager_groups.new + @pager_group.callback_url = params[:callback_url] + @pager_group.pager_group_destination_ids = params[:pager_group_destination_ids] + if @pager_group.save + respond_with @pager_group + end + end + + end + + def destroy + @pager_group = PagerGroup.find(params[:id]) + if @pager_group + @pager_group.destroy + respond_with @pager_group + end + end + + end + end +end |