Sha256: 68d974c8571a3b8b1c5575175ec4543d0a8d9ce013bc4223081a6f00ac62afa9
Contents?: true
Size: 1.06 KB
Versions: 13
Compression:
Stored size: 1.06 KB
Contents
require 'cgi' require 'cgi/session' require 'cgi/session/pstore' require 'action_controller/cgi_ext/cgi_methods' # Wrapper around the CGIMethods that have been secluded to allow testing without # an instantiated CGI object class CGI #:nodoc: class << self alias :escapeHTML_fail_on_nil :escapeHTML def escapeHTML(string) escapeHTML_fail_on_nil(string) unless string.nil? end end # Returns a parameter hash including values from both the request (POST/GET) # and the query string with the latter taking precedence. def parameters request_parameters.update(query_parameters) end def query_parameters CGIMethods.parse_query_parameters(query_string) end def request_parameters CGIMethods.parse_request_parameters(params, env_table) end def redirect(where) header({ "Status" => "302 Moved", "location" => "#{where}" }) end def session(parameters = nil) parameters = {} if parameters.nil? parameters['database_manager'] = CGI::Session::PStore CGI::Session.new(self, parameters) end end
Version data entries
13 entries across 13 versions & 1 rubygems