Created
July 6, 2011 08:39
-
-
Save yorzi/1066846 to your computer and use it in GitHub Desktop.
create a pageless page, click "more" for new paginated results.
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
# usage: | |
# link_to_next_page(@items) | |
# link_to_next_page(@items, :remote => true) # Ajax | |
def link_to_next_page(scope, name, options = {}, &block) | |
param_name = options.delete(:param_name) || Kaminari.config.param_name | |
link_to_unless scope.last_page?, name, {param_name => (scope.current_page + 1)}, options.merge(:rel => 'next') do | |
block.call if block | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment