Spreadhead

spreadhead noun two facing pages of a book or other publication.

Rails content management for pages that shouldn’t be views.

Installation

Spreadhead is a Rails engine. It works with versions of Rails greater than 2.3.

In config/environment.rb:


config.gem "jeffrafter-spreadhead",
  :lib     => 'spreadhead',
  :source  => 'http://gems.github.com'

Vendor the gem:


rake gems:install
rake gems:unpack

Make sure the development database exists and run the generator:


script/generate spreadhead

A number of files will be created and instructions will be printed.

You may already have some of these files. Don’t worry. You’ll be asked if you want to overwrite them.

Run the migration:


rake db:migrate

Modify the initializer in config/initializers/spreadhead.rb to control access.

Routes

Spreadhead installs default catch-all routes. These are given the lowest priority in your application. If your application is already catching these routes then you may not be able to access your spreadhead pages.

Tutorial

Checkout the tutorial.

Authors

Spreadhead is based on the blog post http://neverlet.be/2008/12/17/building-a-content-managment-system by Jeff Rafter

The engine implementation and gem was patterned after the Clearance gem by Thoughtbot.

Suggestions, Bugs, Refactoring?

Fork away and create a Github Issue. Please send pull requests.

When you do:

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don’t break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Documentation

Documentation is available at http://rdoc.info/projects/jeffrafter/spreadhead