From 0a49faf417a993e838d1c37361d573bb86223f75 Mon Sep 17 00:00:00 2001 From: jessib Date: Thu, 29 Nov 2012 15:56:41 -0800 Subject: Not yet done, but more sophisticated and refactored ticket filtering. Still have to do more, including allowing user to pick sort order. --- help/app/controllers/tickets_controller.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'help/app/controllers/tickets_controller.rb') diff --git a/help/app/controllers/tickets_controller.rb b/help/app/controllers/tickets_controller.rb index 2e55c36..1a73df9 100644 --- a/help/app/controllers/tickets_controller.rb +++ b/help/app/controllers/tickets_controller.rb @@ -82,11 +82,8 @@ class TicketsController < ApplicationController def index #TODO: we will need pagination - if admin? - @tickets = Ticket.for_admin(current_user, params) - else - @tickets = Ticket.for_user(current_user, params) - end + @tickets = Ticket.for_user(current_user, params, admin?) + #below works if @tickets is a CouchRest::Model::Designs::View, but not if it is an Array @tickets = @tickets.page(params[:page]).per(10) #TEST #respond_with(@tickets) -- cgit v1.2.3