Can $ rails generate scaffold give me .haml templates in stead of .erb ones?

Skip to first unread message

Wojtek Galaj

Nov 15, 2010, 6:03:40 AM11/15/10
to Haml
Hello everyone.

I am really sorry if this question has been beaten to death. I tried
searching the group but could only find a discussion about maybe
implementing this from way back in 2007.

So, can I get .haml templates from rails 3.0.1 and not have to rename
and transcribe everything?

Thanks in advance,

Neil Funk

Nov 16, 2010, 9:07:31 AM11/16/10
I don't know if there's another way to do this nowadays, but this
works well:

> --
> You received this message because you are subscribed to the Google Groups "Haml" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Dave South

Nov 16, 2010, 12:40:26 PM11/16/10
to Haml
Yes. There are several gems that handle HAML scaffold creation. I've
been using "haml-rails"

In my Gemfile:
gem 'haml-rails', :group => :development

The trick is to set HAML as the default generator in your
application.rb file:

config.generators do |g|
g.template_engine :haml

Now rails generator will know to use HAML instead of ERB.

There are more options for config.generators.

Reply all
Reply to author
0 new messages