Skip to content

thrivesmart/bootscaf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bootscaf

Build Status

Bootscaf is a ruby gem that turns the default rails generate scaffolds into fully bootstrappified scaffolds.

Read more in the original blog post.

Installation

Get it going in your Gemfile:

    gem 'bootscaf', group: :development

Install it with bundle from your command line:

bundle

Usage

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

Examples

Run the bootscaf binary on a Post scaffold/model:

bootscaf update posts

Extras

There are a few conveniences added that we use in the vast majority of our projects. They are:

  1. Helper css class names on the <body> element for page-specific CSS: 
<body class="controller-<%= controller.controller_name.dasherize %> action-<%= controller.action_name.dasherize %>">
  1. Google analytics if an environment variable is set:
ENV["GOOGLE_ANALYTICS_ID"]
  1. A click-to-select css selector for read-only inputs:
<input class="select-all-on-click" type="text" value="long value" readonly>
  1. 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

  1. Fork it ( https://github.com/thrivesmart/bootscaf/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request