github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

norman / haml-scaffold

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 93
    • 18
  • Source
  • Commits
  • Network (18)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (2)
    • REL-1.0.0
    • 1.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Rails scaffold generator that outputs Haml and better functional tests. — Read more

  cancel

http://haml-scaffold.rubyforge.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Correct usage banner message. 
Alexander Kahn (author)
Wed Nov 11 09:44:12 -0800 2009
norman (committer)
Wed Nov 11 09:52:13 -0800 2009
commit  4e5d9107758680795478532180746b8b9fb4736a
tree    b44a0d911457d2baa2dfb29bea3772f6f11f0cd3
parent  4d2f05d65c2dcf5ef0e5992203177a0c3003ab17
haml-scaffold /
name age
history
message
file .gitignore Wed Jul 01 08:09:14 -0700 2009 Upated generator code to Rails 2.3.2. Haml Scaf... [Norman Clarke]
file History.txt Wed Jul 01 08:09:14 -0700 2009 Upated generator code to Rails 2.3.2. Haml Scaf... [Norman Clarke]
file MIT-LICENSE Fri Nov 07 08:20:21 -0800 2008 Initial commit. [Norman Clarke]
file Manifest.txt Wed Jul 01 08:09:14 -0700 2009 Upated generator code to Rails 2.3.2. Haml Scaf... [Norman Clarke]
file README.rdoc Wed Jul 01 08:09:14 -0700 2009 Upated generator code to Rails 2.3.2. Haml Scaf... [Norman Clarke]
file Rakefile Wed Jul 01 08:09:14 -0700 2009 Upated generator code to Rails 2.3.2. Haml Scaf... [Norman Clarke]
directory config/ Tue Feb 10 10:28:05 -0800 2009 Converted to newgem. [Norman Clarke]
directory generators/ Wed Nov 11 09:52:13 -0800 2009 Correct usage banner message. [Alexander Kahn]
file haml_scaffold.gemspec Wed Jul 01 08:09:14 -0700 2009 Upated generator code to Rails 2.3.2. Haml Scaf... [Norman Clarke]
file init.rb Fri Nov 07 08:20:21 -0800 2008 Initial commit. [Norman Clarke]
directory lib/ Wed Jul 01 08:09:14 -0700 2009 Upated generator code to Rails 2.3.2. Haml Scaf... [Norman Clarke]
directory samples/ Wed Jul 01 08:09:14 -0700 2009 Upated generator code to Rails 2.3.2. Haml Scaf... [Norman Clarke]
README.rdoc

Haml Scaffold

A collection of hacks to the Rails scaffold generator, to make it output templates using Haml rather than ERB. You may like some of it, and may hate other parts. You’re free to use it under the terms of the MIT license if the parts you like outweigh the parts you hate.

This scaffold generator does the same thing as the default Rails scaffold generator, with a few differences.

Differences from Rails Scaffolding:

  • Haml not ERB.

Controller

  • Loads object with a before_filter to be DRYer.
  • "Destroy" method handles error conditions.
  • Actions are alphabetized for more obvious consistency.
  • Uses will_paginate.

Controller Test

  • Tests error conditions, not just the "happy path."
  • Has 100% code coverage with RCov.
  • Uses very simple mocking with mocha to limit calls to the DB.

Views

  • Have cleaner, more semantic XHTML that’s easier to quickly replace with your own markup.
  • Are broken up into a couple of partials to be DRYer.
  • Use will_paginate.

Misc

  • Generates Haml layout and SASS stylesheet.

Samples

View them here.

Installation

Haml Scaffold is available on RubyForge as a gem:

  sudo gem install haml_scaffold

You can also install it as a Rails plugin if you wish:

  ./script/plugin install git://github.com/norman/haml-scaffold.git

Dependencies

The generated code will depend on:

  • haml (of course!)
  • will_paginate
  • mocha

You’ll need to add the gem dependencies to your config/environment.rb manually:

  config.gem "haml"
  config.gem "will_paginate"
  config.gem "mocha"

Also, don’t forget to Hamlize your Rails app:

  $ cd my_rails_app
  $ haml --rails .

Other stuff you might be interested in:

  • Haml
  • RSpec Haml scaffold generator

Author

Norman Clarke

This work is derived from code in Ruby on Rails and is released under its same license, the MIT License.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server