Created
December 30, 2010 20:12
-
-
Save diebels727/760229 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
#... | |
current_page = (params[:page] || 1) # <--- I probably should just 'to_i' both current_page and per_page | |
per_page = (params[:per_page] || 25) # <--- | |
#... | |
@reports = WillPaginate::Collection.create(current_page, per_page, @results.count) do |pager| | |
start = (current_page.to_i-1)*per_page # <---- the problem was here. current_page can be a String. | |
pager.replace( @results[start, per_page] ) | |
end | |
#... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment