Skip to content

Generating Layouts and Views

toadkicker edited this page Sep 20, 2014 · 2 revisions

You can run following generators to get started with Bootstrap quickly.

Layout (generates Bootstrap compatible layout) - (Haml and Slim supported)

Usage:

rails g bootstrap:layout [LAYOUT_NAME]

Themed (generates Bootstrap compatible scaffold views.) - (Haml and Slim supported)

Usage:

rails g bootstrap:themed [RESOURCE_NAME]

Example:

rails g scaffold Post title:string description:text
rake db:migrate
rails g bootstrap:themed Posts

Notice the plural usage of the resource to generate bootstrap:themed. As always, you must run db:migrate after scaffolding or the gem will throw an exception and quit generation.