Rails Layout Gem
Rails Layout is a utility gem you can use during development to set up a default application layout with partials for Rails flash messages and navigation links. It is a Rails generator that you add to your Rails application Gemfile.
The Rails Layout gem generates application layout files:
- app/views/layouts/application.html.erb
- app/views/layouts/_messages.html.erb
- app/views/layouts/_navigation.html.erb
There are options to generate layout files suitable for use with the following front-end frameworks:
simple
– simple layoutbootstrap2
– Twitter Bootstrap 2.3- (more to come)
Installation
Add it to your Rails application Gemfile:
group :development do
gem 'rails_layout'
end
If you want to use a newer unreleased version from GitHub:
group :development do
gem 'rails_layout', github: 'RailsApps/rails_layout'
end
Use Bundler to install the gem:
$ bundle install
Simple Layout
To create a set of simple layout files:
$ rails generate layout simple
Twitter Bootstrap 2.3 Layout
To create layout files for use with Twitter Bootstrap 2.3:
$ rails generate layout bootstrap2
Help
To see help messages:
$ rails generate layout --help
Issues
Any issues? Please create an issue on GitHub. Reporting issues (and patching!) helps everyone.
Credits
Daniel Kehoe maintains this gem as part of the RailsApps project.
Please see the CHANGELOG for a list of contributors.
Is the gem useful to you? Follow the project on Twitter: @rails_apps. I’d love to know you were helped out by the gem.
MIT License
Copyright © 2013 Daniel Kehoe