Rails foundationSort Order

Rails: Setting up Assets

In this episode we show you how to setup twitter bootstrap in a rails application. At Codemy we use Sass and CoffeeScript by default.

You can check out bootstrap here

We start out by renaming the assets/javascripts/application.js to assets/javascripts/application.coffee we then fill it up with the following content.

#= jquery#= jquery_ujs#= turbolinks

To setup bootstrap in your rails app simply add the gem to your Gemfile

gem 'bootstrap-sass'

To activate bootstrap in our application simply rename assets/stylesheets/application.css to assets/stylesheets/application.sass and then add the following line:

@import "bootstrap-sprockets"@import "bootstrap"

Once we have the css setup we can now start using the bootstrap styles and components in our application. Watch through the video series to see how we use bootstrap to build our application.