The Rails Layout Gem

Every Rails application needs a well-designed application layout. The
Rails default starter application, which we get when we run rails new,
provides a barebones application layout. It is purposefully simple so
developers can add the code they need to accommodate any front-end
framework (we’ll look closely at front-end frameworks in the next
chapter).

In this chapter we’ll start with a simple application layout file,
adding a little CSS for simple styling. In the next chapter, we’ll
upgrade the application layout file to use the Zurb Foundation front-end
framework.

To make it easy, we’ll use the rails_layout gem to generate files for an
application layout. In this chapter, we’ll use the rails_layout gem to
create our basic layout and CSS files. In the next chapter, we’ll use
the rails_layout gem to create layout files for Zurb Foundation.

In your Gemfile, you’ve already added:

gem 'rails_layout'

and previously run $ bundle install.

Rails provides the rails generate command to run simple scripts that are
packaged into gems.

The rails_layout gem uses the rails generate command to set up files we
need. Run:

$ rails generate layout:install simple --force