From 7da655e0b26c4c061f155beb9e69442d83351d09 Mon Sep 17 00:00:00 2001 From: Meutel Date: Fri, 31 Jul 2015 18:43:18 +0200 Subject: [PATCH] fix bug initial/pagination --- app/helpers/preferences_helper.rb | 2 +- app/views/layouts/_initials.html.erb | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb index fc7863e..4558b3b 100644 --- a/app/helpers/preferences_helper.rb +++ b/app/helpers/preferences_helper.rb @@ -9,7 +9,7 @@ module PreferencesHelper def preferences session[:current_per_page] = params[:per_page] ? params[:per_page].to_i : (session[:current_per_page] || WillPaginate.per_page) if params[:initial] - session[:initial] = (session[:initial] == params[:initial] ? nil : params[:initial]) + session[:initial] = (params[:initial] == "reset" ? nil : params[:initial]) end end diff --git a/app/views/layouts/_initials.html.erb b/app/views/layouts/_initials.html.erb index 0c8a176..651863d 100644 --- a/app/views/layouts/_initials.html.erb +++ b/app/views/layouts/_initials.html.erb @@ -1,9 +1,11 @@ <% initials = ['0'] + ('A'..'Z').to_a %>