apotonick / kaminari-cells

Kaminari pagination in Cells.
MIT License
23 stars 15 forks source link

Escaped HTML with Rails #5

Open Startouf opened 8 years ago

Startouf commented 8 years ago

The <%= paginate %> write escaped HTML to the view

<% p = paginate(collection, theme: 'my_theme')
      p.class # => ActiveSupport::SafeBuffer
      p # => "  <nav class=\"pagination\">\n    \n    &lt;span class=&quot;prev&quot;&gt;\n  
      p.html_safe? # => false
%>

Rails 5 Cells 4.1 cells-rails 0.0.4 kaminari-cells 0.0.4

Will use the CGI.unescapeHTML(String.new(xxx)) hack in the meantime

alexandrebini commented 8 years ago

+1

alvir commented 7 years ago

+1 We need to fix it using follow

module Kaminari
  module Helpers
    class Tag
      alias_method :to_s_old, :to_s
      def to_s(l={})
        to_s_old(l).html_safe
      end
    end
  end
end