Search and pagination using coffeescript