Skip to content

Commit

Permalink
don't return empty string from rel_value
Browse files Browse the repository at this point in the history
  • Loading branch information
gamache committed Oct 12, 2010
1 parent 967b495 commit 4f584ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/will_paginate/view_helpers.rb
Expand Up @@ -364,7 +364,12 @@ def rel_value(page)
when @collection.next_page; 'next'
when 1; 'start'
end
"#{rel} #{@@pagination_options[:rel_value_base]}"
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

def current_page
Expand Down

0 comments on commit 4f584ea

Please sign in to comment.