module Innate::Helper::CGI
Public Class Methods
Public Instance Methods
html_and_code_escape(input)
click to toggle source
safely escape all HTML and code
# File lib/innate/helper/cgi.rb, line 45 def html_and_code_escape(input) Rack::Utils.escape_html(input.to_s).gsub(/#([{@$]@?)/, '#\1') end
Also aliased as: h
html_escape(input)
click to toggle source
Shortcut for Rack::Utils.escape_html
@param [#to_s] input @return [String]
# File lib/innate/helper/cgi.rb, line 32 def html_escape(input) Rack::Utils.escape_html(input.to_s) end
html_unescape(input)
click to toggle source
Shortcut for CGI.unescapeHTML
@param [#to_s] input @return [String]
# File lib/innate/helper/cgi.rb, line 40 def html_unescape(input) ::CGI.unescapeHTML(input.to_s) end
url_decode(input)
click to toggle source
Shortcut for Rack::Utils.unescape
@param [#to_s] input @return [String] URI-decoded representation of
input
# File lib/innate/helper/cgi.rb, line 24 def url_decode(input) Rack::Utils.unescape(input.to_s) end
url_encode(input)
click to toggle source
Shortcut for Rack::Utils.escape
@param [#to_s] input @return [String] URI-encoded representation of
input
# File lib/innate/helper/cgi.rb, line 15 def url_encode(input) Rack::Utils.escape(input.to_s) end
Also aliased as: u