summaryrefslogtreecommitdiff
path: root/app/controllers/api
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-11-20 22:18:20 -0700
committermo khan <mo@mokhan.ca>2014-11-20 22:18:20 -0700
commitc752824f9cdf780d0e09cbcb3eabc3bd762e658c (patch)
tree52509ccc4e224ec8bf84a36907fe5f0520fbdba8 /app/controllers/api
parenta2699047fdf16e8a751f3009458256639d245fd1 (diff)
add photos and users to api v2.
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v2/photos_controller.rb13
-rw-r--r--app/controllers/api/v2/users_controller.rb9
2 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/api/v2/photos_controller.rb b/app/controllers/api/v2/photos_controller.rb
new file mode 100644
index 00000000..c4240327
--- /dev/null
+++ b/app/controllers/api/v2/photos_controller.rb
@@ -0,0 +1,13 @@
+module Api
+ module V2
+ class PhotosController < ApplicationController
+ def index
+ @photos = Photo.page(page).per(per_page)
+ end
+
+ def show(id = params[:id])
+ @photo = Photo.find(id)
+ end
+ end
+ end
+end
diff --git a/app/controllers/api/v2/users_controller.rb b/app/controllers/api/v2/users_controller.rb
new file mode 100644
index 00000000..eaa435b4
--- /dev/null
+++ b/app/controllers/api/v2/users_controller.rb
@@ -0,0 +1,9 @@
+module Api
+ module V2
+ class UsersController < ApplicationController
+ def show(id = params[:id])
+ @user = User.find(id)
+ end
+ end
+ end
+end