Skip to content

Commit

Permalink
bring back "current" classname to current page
Browse files Browse the repository at this point in the history
Listening to @kneath in 8c585a7
  • Loading branch information
mislav committed Jul 28, 2011
1 parent 2a4fdfd commit 0b7a7a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/will_paginate/view_helpers/link_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions spec/view_helpers/action_view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -74,7 +74,7 @@ def render(locals)
link.first['rel'].should == 'next'
end
end
assert_select 'em', '2'
assert_select '.current', '2'
end
end

Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 0b7a7a1

Please sign in to comment.