Commit 1b32760e01512625ead6ccdc1395b5beef22656f
1 parent
dfa2ec85
Exists in
master
and in
1 other branch
Stop using js on search pagination
The pagination don't work with the javascript request See #528
Showing
3 changed files
with
9 additions
and
6 deletions
Show diff stats
app/controllers/problems_controller.rb
... | ... | @@ -125,10 +125,13 @@ class ProblemsController < ApplicationController |
125 | 125 | end |
126 | 126 | |
127 | 127 | def search |
128 | - @problems = Problem.search(params[:search]).for_apps(app_scope).in_env(params[:environment]).all_else_unresolved(params[:all_errs]).ordered_by(params_sort, params_order) | |
129 | - @selected_problems = params[:problems] || [] | |
130 | - @problems = @problems.page(params[:page]).per(current_user.per_page) | |
131 | - render :content_type => 'text/javascript' | |
128 | + ps = Problem.search(params[:search]).for_apps(app_scope).in_env(params[:environment]).all_else_unresolved(params[:all_errs]).ordered_by(params_sort, params_order) | |
129 | + selected_problems = params[:problems] || [] | |
130 | + self.problems = ps.page(params[:page]).per(2) | |
131 | + respond_to do |format| | |
132 | + format.html { render :index } | |
133 | + format.js | |
134 | + end | |
132 | 135 | end |
133 | 136 | |
134 | 137 | protected | ... | ... |
app/views/problems/search.js.haml