summaryrefslogtreecommitdiff
path: root/app/controllers/api
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-07-14 13:12:34 -0600
committermo khan <mo@mokhan.ca>2013-07-14 13:12:34 -0600
commit3a345f7729d2af192973e2241cf71bae2ef69f09 (patch)
treeda7cfa32680e6fe2c541200b3199efce41743753 /app/controllers/api
parentc97f212ebea0a3c245bb915f4b18d8273dc913b7 (diff)
add route to api/v1/creations
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/creations_controller.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/api/v1/creations_controller.rb b/app/controllers/api/v1/creations_controller.rb
new file mode 100644
index 00000000..46d06d4c
--- /dev/null
+++ b/app/controllers/api/v1/creations_controller.rb
@@ -0,0 +1,21 @@
+module Api
+ module V1
+ class CreationsController < ApplicationController
+ before_filter :restrict_access
+ respond_to :json
+
+ def index
+ respond_with Creation.all
+ end
+
+ private
+
+ def restrict_access
+ authenticate_or_request_with_http_token do |token, options|
+ User.exists?(:authentication_token => token)
+ end
+ end
+
+ end
+ end
+end