summaryrefslogtreecommitdiff
path: root/app/controllers/api/v1/phone_numbers_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/v1/phone_numbers_controller.rb')
-rw-r--r--app/controllers/api/v1/phone_numbers_controller.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/controllers/api/v1/phone_numbers_controller.rb b/app/controllers/api/v1/phone_numbers_controller.rb
new file mode 100644
index 0000000..ff58fd3
--- /dev/null
+++ b/app/controllers/api/v1/phone_numbers_controller.rb
@@ -0,0 +1,23 @@
+module Api
+ module V1
+ class PhoneNumbersController < ApplicationController
+ respond_to :json
+
+ def index
+ if params[:ids]
+ @phone_numbers = PhoneNumber.where(:id => params[:ids])
+ else
+ @phone_numbers = PhoneNumber.all
+ end
+
+ respond_with @phone_numbers
+ end
+
+ def show
+ @phone_number = PhoneNumber.find(params[:id])
+
+ respond_with @phone_number
+ end
+ end
+ end
+end