1 module ApplicationHelper
3 return linkify(sanitize(simple_format(text)))
7 return auto_link(text, :link => :urls, :html => { :rel => "nofollow" })
10 def html_escape_unicode(text)
11 chars = ActiveSupport::Multibyte::Chars.u_unpack(text).map do |c|
12 c < 127 ? c.chr : "&##{c.to_s};"
18 def rss_link_to(*args)
19 return link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), Hash[*args], { :class => "rsssmall" });
22 def atom_link_to(*args)
23 return link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), Hash[*args], { :class => "rsssmall" });
26 def javascript_strings
29 js << "<script type='text/javascript'>\n"
30 js << "i18n_strings = new Array();\n"
31 js << javascript_strings_for_key("javascripts")
39 def javascript_strings_for_key(key)
41 value = t(key, :locale => "en")
43 if value.is_a?(String)
44 js << "i18n_strings['#{key}'] = '" << escape_javascript(t(key)) << "';\n"
47 js << javascript_strings_for_key("#{key}.#{k}")