Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
this is an opinionated fork of the vanilla haml-rails
Ruby
tree: e91fe44da2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs/output
lib
test
.gitignore
Gemfile
README.md
Rakefile
haml-rails.gemspec

README.md

This fork

This fork assumes you'll be using formtastic, inherited_resources, twitter_bootstrap, and possibly some other things I can't recall at the moment.

One other thing it does, which you might find annoying: it detects fields named 'name' or 'title' and moves them to the beginning of the attributes with special treatment/classes. This seems to me like a better starting point, but it's just a scaffold!

I've added a few hacky lines of code to the test to copy the scaffold generated by the test fixtures to docs/output. That's so we can visually inspect the scaffolds that are generated, in addition to (currently minimal) unit tests.

Haml-rails

Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.

To use it, add this line to your Gemfile:

gem "haml-rails"

Pretty fancy, eh?

Once you've done that, any time you generate a controller or scaffold, you'll get Haml instead of ERB templates. On top of that, when your Rails application loads, Haml will be loaded and initialized completely automatically! The modern world is just so amazing.

Contributors

Haml generators originally from rails3-generators, and written by José Valim, André Arko, Paul Barry, Anuj Dutta, Louis T, and Chris Rhoden. Tests originally written by Louis T.

License

Ruby license or MIT license, take your pick.

Something went wrong with that request. Please try again.