Bootscaf
Bootscaf is a ruby gem that turns the default rails generate scaffolds into fully bootstrappified scaffolds.
Read more in the original blog post.
- Supported Bootstrap Version:
3.x - Supported JQuery Version:
2.x - Supported Ruby on Rails Version:
4.x
Installation
Get it going in your Gemfile:
gem 'bootscaf', group: :developmentInstall it with bundle from your command line:
bundleUsage
Run the bootscaf binary on a single scaffold (e.g. users) from your rails project's base directory:
bootscaf update NNNsOR Run bootscaf binary on all scaffolds:
bootscaf update --allOf course, get help any time simply by running the naked bootscaf binary:
bootscafExamples
Run the bootscaf binary on a Post scaffold/model:
bootscaf update postsExtras
There are a few conveniences added that we use in the vast majority of our projects. They are:
- Helper css class names on the
<body>element for page-specific CSS:
<body class="controller-<%= controller.controller_name.dasherize %> action-<%= controller.action_name.dasherize %>">- Google analytics if an environment variable is set:
ENV["GOOGLE_ANALYTICS_ID"]- A click-to-select css selector for read-only inputs:
<input class="select-all-on-click" type="text" value="long value" readonly>- Page
<title>s set in views:
<% content_for :page_title do %>
Edit Model —
<% end %>And that’s about it, for now!
Running Tests
bundle exec rspec spec
Contributing
- Fork it ( https://github.com/thrivesmart/bootscaf/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request