Skip to content

Commit

Permalink
Fixes escaped HTML in the will_paginate_links
Browse files Browse the repository at this point in the history
  • Loading branch information
dball committed Apr 11, 2012
1 parent 49e0f57 commit a87e106
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
# v0.0.2rc

* Fixes escaped HTML in the will_paginate links
* Includes vendor in gemspec file manifest

# v0.0.1
Expand Down
2 changes: 1 addition & 1 deletion lib/paginated_table/view_helpers.rb
Expand Up @@ -146,7 +146,7 @@ def sort_link(text, sort_on)

def tag(name, value, attributes = {})
if name == :a
@template.link_to(value, attributes.delete(:href), attributes.merge(:remote => true))
@template.link_to(value.to_s.html_safe, attributes.delete(:href), attributes.merge(:remote => true))
else
super
end
Expand Down
4 changes: 3 additions & 1 deletion test/units/view_helpers_test.rb
Expand Up @@ -137,8 +137,10 @@ module PaginatedTable

describe "#tag" do
it "calls link_to on the view with the :remote option for :a tags" do
html_safe_text = stub("html_safe_text")
text = stub("text", :to_s => stub("string", :html_safe => html_safe_text))
view.expects(:link_to).
with(text, href, { :class => 'highlight', :remote => true }).
with(html_safe_text, href, { :class => 'highlight', :remote => true }).
returns(link)
renderer.tag(:a, text, :class => 'highlight', :href => href).must_equal link
end
Expand Down

0 comments on commit a87e106

Please sign in to comment.