Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 13 additions and 6 deletions.
  1. +1 −1 lib/will_paginate/version.rb
  2. +12 −5 lib/will_paginate/view_helpers.rb
View
2 lib/will_paginate/version.rb
@@ -2,7 +2,7 @@ module WillPaginate
module VERSION
MAJOR = 2
MINOR = 3
- TINY = 15
+ TINY = 16
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
17 lib/will_paginate/view_helpers.rb
@@ -32,7 +32,8 @@ module ViewHelpers
:params => nil,
:renderer => 'WillPaginate::LinkRenderer',
:page_links => true,
- :container => true
+ :container => true,
+ :rel_value_base => nil # contents applied to each per-link rel=""
}
mattr_reader :pagination_options
@@ -358,10 +359,16 @@ def url_for(page)
private
def rel_value(page)
- case page
- when @collection.previous_page; 'prev' + (page == 1 ? ' start' : '')
- when @collection.next_page; 'next'
- when 1; 'start'
+ rel = case page
+ when @collection.previous_page; 'prev' + (page == 1 ? ' start' : '')
+ when @collection.next_page; 'next'
+ when 1; 'start'
+ end
+ rel_value_base = WillPaginate::ViewHelpers.pagination_options[:rel_value_base]
+ if rel || rel_value_base
+ "#{rel} #{rel_value_base}".gsub(/(?: ^\s+ | \s+$)/x, '') # trim whitespace
+ else
+ nil
end
end

No commit comments for this range

Something went wrong with that request. Please try again.