Build Status Code Climate Gem Version


Shoestrap is used @ Screen Concept for generating new Rails Apps and creating admin backends. Shoestrap is pretty opinionated and tailored to the way we work. Your mileage may vary!


  • generate new rails apps with a sc flavored setup
  • generate admin backends with view inheritance and inhertied_resources

Building a Rails App with shoestrap

Generating a new application

You can generate a new rails application with shoestrap by using the shoestrap new command:

shoestrap new foo

Since shoestrap new is just a wrapper for rails new, the options you can pass to rails new can also be given to shoestrap. Additionally you can specify following shoestrap specific options on the command line:

--kuhsaft=true   # Will install and set up the Rails app with Kuhsaft
--css=bootstrap  # Will set up the app to use the given CSS
                 # Framework. Available frameworks: foundation, bootstrap

Generating a CMS Resource

Use the cms generator to generate a simple CRUD Backend for a given resource:

rails generate shoestrap:cms car wheels:integer model:string
rake db:migrate

In the generated model you can specify which attributes are shown in the index view, and which attributes are editable.

The CRUD Backend will be available under /cms/

CMS Resources and Associations

If you want to show the name of an associaton, build a wrapper method for it in the model and add it to the index_attributes.

Adding Authentication to the CMS

The shoestrap admin generator will add an Admin model that uses devise for authentication. It is not registerable, so you will have to create the first user in the rails console.

Meta Tags

Shoestrap expects you to define a content_for :head block where you define things like descritpion and keyword metatags, page title etc:

= content_for :head do
  %title 'Define how your page title is built'
  %meta{ name: 'keywords', 'content: set some keywords if you like' }
  %meta{ name: 'description', content: 'add a description!' }

Kuhsaft already uses this for it's pages starting from version 2.2.0. If you do not define a content_for block, the meta tags will be set to default values!

Test shoestrap "compliance"

You can check how much your existing Applicaiton complies with the current shoestrap featureset by running the integration tests against your application. You can do this via the TARGET_APP environment variable:

TARGET_APP=../some_rails_project rake features

Development & Contributing

See the CONTRIBUTING file for project specific guidelines.

Run specs in DEBUG mode

You can run the integration tests in debug mode. The test helpers that generate the dummy apps will then be more verbose:

DEBUG=true rake features

If you don't want debug mode anymore, remember to unset the DEBUG variable:

unset DEBUG


See the file LICENSE.