the line
rails new someapp -m haml
doesn't work. It seems to need a path to some where.
Update: haml-rails
is in fact installed by gem install haml-rails
but the line above wouldn't work.
The really short version
Generate a new rails app based on a simple template that sets up Haml out of the box (and some other nice optional features).
rails new ProjectName -m https://raw.github.com/RailsApps/rails3-application-templates/master/rails3-haml-html5-template.rb
http://decielo.com/articles/377/haml-by-default-in-a-new-rails-3-2-app
Also check this out:
https://github.com/RailsApps/rails-composer
EDIT:
If you want to do this through the "gem" you simply need to run the default command
rails new myapp -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
This is a safe command as it points to the master branch of the gem and will be a stable URL. Once you have run this command you will be prompted with options. Simply select HAML and SASS when asked by the wizard.
Gem haml-rails
allows to generate views in Haml, but not the initial layout.
After running rails new someapp
(note: w/o -m haml
) and adding line gem "haml-rails"
to your Gemfile
, you just need to rename application.html.erb
to application.html.haml
and manually convert its content from ERB to Haml.
After that, all generated views will be in Haml.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With