No commit activity in last 3 years
No release in over 3 years
Bootstrap CDN support for Rails 3 and 4
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

bootstrap-cdn-rails

Easily add support for BootstrapCDN hosted assets to your Rails 3 or 4 project.

Benefits

  • Offloads loading of the Bootstrap, Font Awesome and Bootswatch assets from your host, allowing your browser to execute more HTTP requests in parallel - resulting in faster overall page loads.
  • Leverages the cached copy on a client so your page will load faster if a user already has visited a site using a CDN hosted copy of Bootstrap, Font Awesome or Bootswatch.

Features

Installation

Gemfile

Update your Gemfile to include this gem:

...
gem 'bootstrap-cdn-rails'

Run bundle install to update your local gems. Restart your Rails server if necessary.

Layout

The gem will add the following helpers:

  • boostrap_css_include_tag
  • boostrap_js_include_tag
  • fontawesome_css_include_tag
  • bootswatch_css_include_tag

Add these to your layout files inside the head section to automatically include the relevant library.

<!DOCTYPE html>
<html>
  <head>
    ...
    <%= fontawesome_css_include_tag %>
    ...
  </head>
 ...

License

(c) 2014 Christopher Brito

MIT License - reference LICENSE file