Ruby CGI Functions

EditRocket provides the following information on CGI functions in the Ruby source code builder.

cookie(options) - make raw cookie string

error() - print error message to $> and exit

escape(str) - escape url encode

escapeElement(string, *elements) - Escape only the tags of certain HTML elements in string.

escapeHTML(string) - Escape special characters in HTML, namely &\"<>

header(*options) - make HTTP header string

header(*options) - make HTTP header string

message"(message, title = \"\", header = [\"Content-Type: text/html\"]) - print message to $>

new(type = "query") - Creates a new CGI instance.

out(options = "text/html") - Print an HTTP header and body to $DEFAULT_OUTPUT ($>)

parse(query) - Parse an HTTP query string into a hash of key=>value pairs.

pretty(string, shift = " ") - Prettify (indent) an HTML string.

print(*options) - print HTTP header and string to $>

print(*options) - print HTTP header and string to $>

read_from_cmdline() - offline mode. read name=value pairs on standard input.

rfc1123_date(time) - make rfc1123 date string

tag"(element, attributes = {}) - make HTML tag string

unescape(str) - unescape url encoded

unescapeElement(string, *elements) - Undo escaping such as that done by CGI::escapeElement()

unescapeHTML(string) - Unescape a string that has been HTML-escaped