Commit d0906c67

mo khan <mo@mokhan.ca>
2014-11-23 04:19:09
restrict the number of tutorials that can be fetched at once.
1 parent c9b162d
Changed files (2)
app
assets
javascripts
controllers
app/assets/javascripts/backbone/cakeside.js.coffee
@@ -61,7 +61,7 @@ window.CakeSide =
     CakeSide.Application.reqres.setHandler 'ProfilesRepository', =>
       @profiles ||= new CakeSide.Collections.ProfilesCollection()
 
-    @cakes.fetch(reset: true).done ->
-      CakeSide.Application.start()
     @categories.fetch(reset: true)
     @tutorials.fetch(reset: true)
+    @cakes.fetch(reset: true).done ->
+      CakeSide.Application.start()
app/controllers/api/v1/tutorials_controller.rb
@@ -1,10 +1,8 @@
 module Api
   module V1
     class TutorialsController < ApiController
-      respond_to :json
-
       def index
-        respond_with(@tutorials = current_user.tutorials)
+        @tutorials = current_user.tutorials.page(page).per(per_page)
       end
 
       def create