Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bring back "current" classname to current page

Listening to @kneath in 8c585a7
  • Loading branch information...
commit 0b7a7a198e8431e5d0a1c28858b52f46bdeeee4c 1 parent 2a4fdfd
@mislav authored
View
2  lib/will_paginate/view_helpers/link_renderer.rb
@@ -44,7 +44,7 @@ def page_number(page)
unless page == current_page
link(page, page, :rel => rel_value(page))
else
- tag(:em, page)
+ tag(:em, page, :class => 'current')
end
end
View
6 spec/view_helpers/action_view_spec.rb
@@ -50,7 +50,7 @@ def render(locals)
end
assert_select 'span', 1
assert_select 'span.disabled:first-child', '← Previous'
- assert_select 'em', '1'
+ assert_select 'em.current', '1'
pagination.first.inner_text.should == '← Previous 1 2 3 Next →'
end
end
@@ -74,7 +74,7 @@ def render(locals)
link.first['rel'].should == 'next'
end
end
- assert_select 'em', '2'
+ assert_select '.current', '2'
end
end
@@ -109,7 +109,7 @@ def renderer.gap() '<span class="my-gap">~~</span>' end
paginate
expected = <<-HTML
<div class="pagination"><span class="previous_page disabled">&#8592; Previous</span>
- <em>1</em>
+ <em class="current">1</em>
<a href="/foo/bar?page=2" rel="next">2</a>
<a href="/foo/bar?page=3">3</a>
<a href="/foo/bar?page=2" class="next_page" rel="next">Next &#8594;</a></div>
Please sign in to comment.
Something went wrong with that request. Please try again.