1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Gregory Eremin 722c155a42 Readme fixes 9 years ago
data Initial commit 9 years ago
lib Readme fixes 9 years ago
.gitignore Initial commit 9 years ago
Gemfile Initial commit 9 years ago
LICENSE.txt Initial commit 9 years ago
README.md Readme fixes 9 years ago
Rakefile Readme fixes 9 years ago
cdnjs-rails.gemspec Initial commit 9 years ago

README.md

cdnjs helpers for Rails apps

This gem adds view helpers to Ruby on Rails applications that embed javascripts and stylesheets directly from cdnjs

Installation

Add this line to your application's Gemfile:

gem 'cdnjs-rails'

And then execute:

$ bundle

Usage

From view files

<html>
<head>
  <title>Hello World!</title>
  <%= stylesheet_cdnjs_tag 'normalize' %>
</head>
<body>
  <%= yield %>
  <%= javascript_cdnjs_tag 'jquery', version: '2.0.3', protocol: 'https' %>
</body>
</html>

From anywhere in the app

CdnjsRails.package_url('chosen', v: '0.9.10', proto: 'http')

Options

version (aliases: ver, v): package version, latest by default

protocol (alias: proto): url protocol, relative by default

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request