adamlogic / showoff

Rails plugin that provides an easy way to include and show off html/erb/haml mockups

This URL has Read+Write access

nummi (author)
Sun Nov 15 11:33:28 -0800 2009
adamlogic (committer)
Sun Nov 15 11:43:46 -0800 2009
commit  fb6c23476ac6a05cd011f35c5f247d7011953a99
tree    df04ccae3d471190fdde9c78c90bd0b4732e95a3
parent  81d64583db80e3d315806f6b5cb30038e40d5fa4
name age message
file MIT-LICENSE Tue Apr 14 05:23:09 -0700 2009 initial commit [adamlogic]
file README.rdoc Tue Apr 14 18:21:33 -0700 2009 fix handling of alternate layout [adamlogic]
file Rakefile Tue Apr 14 05:23:09 -0700 2009 initial commit [adamlogic]
directory app/ Sun Nov 15 11:43:46 -0800 2009 Save last viewed template to session. [nummi]
directory config/ Tue Apr 14 05:23:09 -0700 2009 initial commit [adamlogic]
directory generators/ Tue Apr 14 18:21:33 -0700 2009 fix handling of alternate layout [adamlogic]
file init.rb Tue Apr 14 05:23:09 -0700 2009 initial commit [adamlogic]
directory test/ Tue Apr 14 05:23:09 -0700 2009 initial commit [adamlogic]
README.rdoc

Showoff

The showoff plugin gives you a simple way to throw arbitrary HTML mockups into your appliction. You can use static HTML, ERB, or any other templating language (such as HAML) that your application supports.

How do I install it?

  script/plugin install git://github.com/adamlogic/showoff.git
  script/generate showoff

Are there any dependencies?

Yes, this plugin only works with Rails 2.3, thanks to the support for Rails Engines, which basically lets you embed a "mini app" inside of your main app.

How do I use it?

Just throw your mockups into app/views/mockups, then navigate to /mockups in your app. Just like any other Rails view, you can use partials, helpers, etc. If you want to use a layout other than your application default, tack it on as an additional file extension (example.html.erb.alternate).

Can I see an example?

Once you’ve run the generator, navigate to /mockups in your app to see some examples.

What’s the point of this?

  • Avoid duplicating headers, footers, and other layout cruft by using the same layouts that the rest of your app uses.
  • By using the same CSS and JS files as the rest of your app, you avoid the pain of merging these things in later.
  • Use partials to keep your mockups more maintainable.
  • Because you have access to Ruby (as opposed to static HTML mockups), you can take advantage of looping to avoid duplication.
  • If you have a library such as Faker installed, you can use it to generate fake data and Lorum Ipsum text, rather than pasting it in.
  • Easily use your templating language of choice when building mockups (I use HAML).
  • Because your mockups can follow the same style and conventions as application code, showoff can drastically reduce the time it takes to wire up a mockup.

Copyright © 2009 Adam McCrea, released under the MIT license