Adding Compass to your Ruby on Rails setup
Compass is a Sass library with prebuilt functions and mixins. In this recipe, you will learn how to use Compass for your RoR applications.
Getting ready
Read Chapter 6, Using Compass, of this book to learn more about Compass and also read the Hello world with Ruby on Rails recipe of this chapter to find out how to set up a RoR web application.
How to do it...
Learn how to add Compass to your RoR set up:
- Create a new Rails app by running the following command in your console:
rails new recipe3
- Run, as already described in the Hello world with Ruby on Rails recipe, the
controller
generator and tell it that you want a controller calledwelcome
with an action calledindex
, using the following command:bin/rails generate controller welcome index
- Then add the
compass-rails
gem line to your application's Gemfile, as follows:gem 'compass-rails'
- Don't forget to run the
bundle
command in your console after the previous step. - Change your
application...