summaryrefslogtreecommitdiff
path: root/app/controllers/api/v1/switchboard_entries_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/v1/switchboard_entries_controller.rb')
-rw-r--r--app/controllers/api/v1/switchboard_entries_controller.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/controllers/api/v1/switchboard_entries_controller.rb b/app/controllers/api/v1/switchboard_entries_controller.rb
new file mode 100644
index 0000000..688f108
--- /dev/null
+++ b/app/controllers/api/v1/switchboard_entries_controller.rb
@@ -0,0 +1,23 @@
+module Api
+ module V1
+ class SwitchboardEntriesController < ApplicationController
+ respond_to :json
+
+ def index
+ if params[:ids]
+ @switchboard_entries = SwitchboardEntry.where(:id => params[:ids])
+ else
+ @switchboard_entries = SwitchboardEntry.all
+ end
+
+ respond_with @switchboard_entries
+ end
+
+ def show
+ @switchboard_entry = SwitchboardEntry.find(params[:id])
+
+ respond_with @switchboard_entry
+ end
+ end
+ end
+end \ No newline at end of file