summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2017-09-24 13:27:31 -0600
committermo <mo.khan@gmail.com>2017-09-24 13:27:31 -0600
commitdc702a89811e866eec20cc43763096dddf4a41fe (patch)
tree40a8e9bc97dedefec9b82331ce499d8189da7dc9 /app/controllers
parent5395834ccb947dd90e6412e2b27d9e9f120e1ce2 (diff)
extract my cakes controller.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/my/cakes_controller.rb7
-rw-r--r--app/controllers/my/dashboard_controller.rb2
2 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/my/cakes_controller.rb b/app/controllers/my/cakes_controller.rb
new file mode 100644
index 00000000..bfc85dc7
--- /dev/null
+++ b/app/controllers/my/cakes_controller.rb
@@ -0,0 +1,7 @@
+module My
+ class CakesController < BaseController
+ def index
+ @cakes = current_user.creations.includes(:photos)
+ end
+ end
+end
diff --git a/app/controllers/my/dashboard_controller.rb b/app/controllers/my/dashboard_controller.rb
index 158dc91c..c3e551bc 100644
--- a/app/controllers/my/dashboard_controller.rb
+++ b/app/controllers/my/dashboard_controller.rb
@@ -1,7 +1,7 @@
module My
class DashboardController < BaseController
def index
- @cakes = current_user.creations.includes(:photos)
+ @cakes = current_user.creations.includes(:photos).limit(6)
@tutorials = current_user.tutorials.limit(10)
@activities = current_user.recent_activities
end