Thursday 12 March 2009

Newbie guide to setting up a 2.3 rails app with HAML

These are the commands I used to install Rails 2.3 and set up an app with rspec_haml_scaffold.
This assumes you have Ruby and Git installed.

Install rails:

gem install rails --source http://gems.rubyonrails.org
Create your app and cd to it:
rails myapp
cd myapp
Install the plugin
script/plugin install --source git://github.com/dfischer/rspec-haml-scaffold-generator.git
Configure the rails plugin for your app
haml --rails .

Now you can go ahead and new the scaffolding feature to create all the usuall models and controllers but the neat part is, it creates views in HAML.

For Example:
script/generate rspec_haml_scaffold User Email:string Password:string Username:string FirstName:string LastName:string

No comments:

Post a Comment