kaminari-cells icon indicating copy to clipboard operation
kaminari-cells copied to clipboard

Escaped HTML with Rails

Open Startouf opened this issue 8 years ago • 2 comments

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

Startouf avatar Jun 21 '16 23:06 Startouf

+1

alexandrebini avatar Jul 26 '16 02:07 alexandrebini

+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

alvir avatar Nov 25 '16 14:11 alvir