Sha256: 93049a39a5f141d12376ebd98b3f37b8ab292b523b7a230d7100e11cae75b23d

Contents?: true

Size: 524 Bytes

Versions: 1

Compression:

Stored size: 524 Bytes

Contents

module CDNJS
  module ViewHelpers
    def cdnjs_include_tag(cdn_vars)

      js_string_output = Array.new

      cdn_vars.each do |js_file_config|
          
        js_string_output << javascript_include_tag("//cdnjs.cloudflare.com/ajax/libs/#{js_file_config['cdnjs']}")
        js_string_output << javascript_tag("window.jQuery || document.write(unescape('#{javascript_include_tag(js_file_config['localpath']).gsub('<','%3C')}'))")
      
      end

      return js_string_output.join("\n").html_safe

    end
  end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cdnjs-rails-0.0.1 lib/cdnjs-rails/view_helpers.rb