Bootscaf is a ruby gem that turns the default rails generate scaffold
s 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
Get it going in your Gemfile
:
gem 'bootscaf', group: :development
Install it with bundle
from your command line:
bundle
Run the bootscaf
binary on a single scaffold (e.g. users
) from your rails project's base directory:
bootscaf update NNNs
OR Run bootscaf
binary on all scaffolds:
bootscaf update --all
Of course, get help any time simply by running the naked bootscaf
binary:
bootscaf
Run the bootscaf
binary on a Post
scaffold/model:
bootscaf update posts
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!
bundle exec rspec spec
- 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