Sha256: 0588a6e734e6b6b6ae700ad27fbbd4ce6f139da70ae33821a82e94cffcf78772

Contents?: true

Size: 563 Bytes

Versions: 16

Compression:

Stored size: 563 Bytes

Contents

# encoding: utf-8

# Adapted from the rails3 compatibility shim in Haml 2.2
module Formtastic
  # @private
  module Util
    extend self
    ## Rails XSS Safety

    # Returns the given text, marked as being HTML-safe.
    # With older versions of the Rails XSS-safety mechanism,
    # this destructively modifies the HTML-safety of `text`.
    #
    # @param text [String]
    # @return [String] `text`, marked as HTML-safe
    def html_safe(text)
      if text.respond_to?(:html_safe)
        text.html_safe
      else
        text
      end
    end

  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
formtastic-2.2.1 lib/formtastic/util.rb
formtastic-2.2.0 lib/formtastic/util.rb
formtastic-2.2.0.rc lib/formtastic/util.rb
formtastic-2.1.1 lib/formtastic/util.rb
formtastic-2.1.0 lib/formtastic/util.rb
formtastic-2.1.0.rc lib/formtastic/util.rb
formtastic-2.1.0.beta1 lib/formtastic/util.rb
formtastic-2.0.2 lib/formtastic/util.rb
formtastic-2.0.1 lib/formtastic/util.rb
formtastic-2.0.0 lib/formtastic/util.rb
formtastic-2.0.0.rc5 lib/formtastic/util.rb
formtastic-2.0.0.rc4 lib/formtastic/util.rb
formtastic-2.0.0.rc3 lib/formtastic/util.rb
formtastic-2.0.0.rc2 lib/formtastic/util.rb
formtastic-2.0.0.rc1 lib/formtastic/util.rb
nuatt-formtastic-0.2.3 lib/formtastic/util.rb