summaryrefslogtreecommitdiff
path: root/app/controllers/my
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-05-21 21:51:50 -0600
committermo khan <mo@mokhan.ca>2014-05-21 21:51:50 -0600
commit802e38c704c8a2534a4d489ff18d14e62460c437 (patch)
treefecf1d432fa0e98cc8a7ff9345913a86b311632e /app/controllers/my
parenta3704519c208785022c281d2add669d7b13887c0 (diff)
move creations#mine to my/cakes.
Diffstat (limited to 'app/controllers/my')
-rw-r--r--app/controllers/my/base_controller.rb11
-rw-r--r--app/controllers/my/cakes_controller.rb7
2 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/my/base_controller.rb b/app/controllers/my/base_controller.rb
new file mode 100644
index 00000000..d8ea0c48
--- /dev/null
+++ b/app/controllers/my/base_controller.rb
@@ -0,0 +1,11 @@
+module My
+ class BaseController < ApplicationController
+ before_filter :restrict_access!
+
+ private
+
+ def restrict_access!
+ redirect_to root_path unless signed_in?
+ end
+ end
+end
diff --git a/app/controllers/my/cakes_controller.rb b/app/controllers/my/cakes_controller.rb
new file mode 100644
index 00000000..03c8e0d6
--- /dev/null
+++ b/app/controllers/my/cakes_controller.rb
@@ -0,0 +1,7 @@
+module My
+ class CakesController < BaseController
+ def index
+ @creations = current_user.creations.includes([:user]).page(params[:page]).per(12)
+ end
+ end
+end