summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-28 11:38:20 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-28 11:38:20 +0200
commit33aea41708b94f480b6eaad760e26abe17a37dfa (patch)
treea1e0620cb16192cbdb5ec3a36041a9a94a348194 /app/controllers/application_controller.rb
parent70c2e1d773291b4854da5a3b479baa352428bb4b (diff)
downloadgitlab-ce-33aea41708b94f480b6eaad760e26abe17a37dfa.tar.gz
Drop rjs from Infinite scrolling
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 68ea636ccfe..94ce8e0616c 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -174,4 +174,18 @@ class ApplicationController < ActionController::Base
filters = cookies['event_filter'].split(',') if cookies['event_filter'].present?
@event_filter ||= EventFilter.new(filters)
end
+
+ # JSON for infinite scroll via Pager object
+ def pager_json(partial, count)
+ html = render_to_string(
+ partial,
+ layout: false,
+ formats: [:html]
+ )
+
+ render json: {
+ html: html,
+ count: count
+ }
+ end
end