title: Rails: Error using ActionView method sanitize in Lib
body: <p>I am attempting to use the Sanitize method from ActionView.</p>
  
  <p>The line <code>r_str = Helper.instance.sanitize(r_str, :tags =&gt; @@allowed_tags, :attributes =&gt; @@allowed_attribs)</code> is giving me the error</p>
  
  <pre><code>undefined method `white_list_sanitizer' for Parsers::HTML::Helper:Class
  </code></pre>
  
  <p>This is my code in <code>lib/parsers.rb</code></p>
  
  <pre><code>module Parsers
    module HTML
      @@allowed_tags = %w(--snip--)
      @@allowed_attribs = %w(--snip--)
  
      class Helper
          include Singleton
          include ActionView::Helpers::SanitizeHelper
      end
  
      #Use built-in santizer and the Hpricot plugin
      def self.clean(str)
        rgx = /&lt;code&gt;(.*?)&lt;\/code&gt;/ #All html within a code tag should be escaped.
        r_str = str.gsub(rgx) { |match| "&lt;code&gt;" + CGI.escapeHTML(match[5..-7]) + "&lt;/code&gt;" } # TODO: test this.
        r_str = Helper.instance.sanitize(r_str, :tags =&gt; @@allowed_tags, :attributes =&gt; @@allowed_attribs)
        Hpricot(r_str)
      end
  
    end
  
    --snip-- 
  
  end
  </code></pre>
  
  <p>What am I doing wrong? </p>
  
  <p>(Please do not comment on the dangers of allowing user submitted HTML, I know the risks)  </p>