diff options
| author | Michel Etienne | 2014-05-02 09:41:36 +0200 | 
|---|---|---|
| committer | Michel Etienne | 2014-05-02 09:41:36 +0200 | 
| commit | 62e398c96e60ecb1a424a7fbbde4022220441f69 (patch) | |
| tree | f3835ba8ba42ffe779a37d55cc9e952094f45229 /app/controllers/access_points_controller.rb | |
| parent | 31455ed1e2dfe68bbba0173821a8c47ad39eccaf (diff) | |
| download | chouette-core-62e398c96e60ecb1a424a7fbbde4022220441f69.tar.bz2 | |
Fix filters use with will paginate when active filter return less pages than current, Mantis 20954
Diffstat (limited to 'app/controllers/access_points_controller.rb')
| -rw-r--r-- | app/controllers/access_points_controller.rb | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/app/controllers/access_points_controller.rb b/app/controllers/access_points_controller.rb index d26595a85..6203cefab 100644 --- a/app/controllers/access_points_controller.rb +++ b/app/controllers/access_points_controller.rb @@ -8,9 +8,16 @@ class AccessPointsController < ChouetteController    respond_to :html, :kml, :xml, :json -  def index +  def index          request.format.kml? ? @per_page = nil : @per_page = 12 -    index! + +    index! do |format| +      format.html { +        if collection.out_of_bounds? +          redirect_to params.merge(:page => 1) +        end +      } +    end           end    def show | 
