Friday, October 18, 2013

Automatically generate ERB

There are plenty of hits on how you can tell Rails to automatically generate HAML, but I still love using ERB. Taking a guess with the pattern for automatically generating HAML, it appears I got it right.

Somehow, Comfortable Mexican Sofa buries the setting for automatically generating HAML in some dark corner of it's codebase. Setting the preference in config/application.rb takes precedence, thank goodness.

    config.generators do |g|
       # g.template_engine :haml
       g.template_engine :erb
    end    

1 comment:

Anonymous said...

I think it has less to do with CMS but rather haml-rails gem. I think it highjacks generator to output haml instead of erb.