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