Skip to content
This repository
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 Gemfile
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 carpentry.gemspec
README.md

Carpentry

Handcrafted prototypes with ease.

Installation

Add Carpentry to Gemfile:

gem "carpentry", "~> 2.1.1"

Run the generator to create the prototypes folder (and inject the Carpentry route):

rails generate carpentry:install

Usage

Put your views in app/views/carpentry/prototypes and view them in browser at /p/path_to_file.

Examples:

URI Path File path
/p app/views/carpentry/prototypes/index.html.erb
/p/home app/views/carpentry/prototypes/home.html.haml
/p/posts/new app/views/carpentry/prototypes/posts/new.html.slim

All available Rails helpers work nicely. Pure prototyping bliss!

If you want an special layout for your prototypes, stick the layout file to app/views/layouts/carpentry/prototypes.html.[format].

You can customize the prototype URI prefix (/p) by editing the engine mount in your roures.rb file, for example:

  mount_carpentry_at "/prototype"

Hooks

Carpentry let's you add a #before_carpentry method in ApplicationController, that will be run before any prototype. You can use it, for example, to provide authentication or prevent prototypes from being rendered in production.

Rails and Ruby compatiblity

Carpentry is compatible with Rails 3.2 and Rails 4.0.

Only Ruby 1.9.3 and above are supported, check Travis CI for build details.

If you want to use Carpentry with Ruby 1.9.2 or below, use Carpentry v1.0.1.

Gotchas

When rendering a partial, you must specify the full path (e.g. carpentry/prototypes/posts/form) unless the partial is in app/views/carpentry/prototypes/.

License

MIT License. Copyright 2011-2013 Kisko Labs.

CI Build Status

Build Status

Something went wrong with that request. Please try again.