Sha256: 1ca715837c57e4789b041f7e6c984b4ca61c7ab87301634ff7a36a127a029d1d

Contents?: true

Size: 781 Bytes

Versions: 1

Compression:

Stored size: 781 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

module Ramaze

  # Shortcuts to some CGI methods

  module CgiHelper
    private

    # shortcut for CGI.escape

    def url_encode(*args)
      CGI.escape(*args)
    end

    # shortcut for CGI.unescape

    def url_decode(*args)
      CGI.unescape(*args)
    end

    # shortcut for GCI.escapeHTML

    def html_escape(string)
      CGI.escapeHTML(string)
    end

    # shortcut for GCI.unescapeHTML
    
    def html_unescape(string)
      CGI.unescapeHTML(string)
    end

    # one-letter versions help in case like #{h foo.inspect}
    # ERb/ERuby/Rails compatible 
    alias h html_escape
    alias u url_encode

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ramaze-0.1.2 lib/ramaze/helper/cgi.rb