module Rad module JavascriptHelper def javascript_include_tag *scripts Array(scripts).collect{|script| tag :script, '', src: "#{config && config.url_root!}#{script}", type: "text/javascript" }.join("\n") end def javascript_tag value = nil, &block args = [{type: "text/javascript"}] args.unshift value if value tag :script, *args, &block end # Escape def js obj; obj.to_s.js_escape end end end