Commit f3134c2a authored by Alfredo Sumaran's avatar Alfredo Sumaran

Expose todos_per_page variable

parent 5c81fc43
class @Todos
PER_PAGE = 20
constructor: (@name) ->
@todos_per_page = gon.todos_per_page || 20
@clearListeners()
@initBtnListeners()
......@@ -70,7 +69,7 @@ class @Todos
currPages = @getRenderedPages()
currPage = @getCurrentPage()
newPages = Math.ceil(total / PER_PAGE)
newPages = Math.ceil(total / @todos_per_page)
url = location.href # Includes query strings
# Refresh if no remaining Todos
......
......@@ -2,6 +2,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
before_action :find_todos, only: [:index, :destroy, :destroy_all]
def index
gon.todos_per_page = Todo.default_per_page
@todos = @todos.page(params[:page])
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment