Posted By

noah on 12/11/08


quote hack template rails quotes standards web single tip markup workaround haml SASS double quotations

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Easiest way to make HAML use double quotes instead of single quotes

 / Published in: Ruby

URL:[email protected]/msg02189.html

Fortunately all it takes to make double quotes the global default for attribute wrappers in HAML is to change one line in the installed gem source.

If you're on a Mac, remember to sudo when you edit the source of an installed gem.

  1. # On line 63 of haml-2.1.0/lib/haml/engine.rb, change
  3. :attr_wrapper => "'",
  5. # to
  7. :attr_wrapper => "\"",

Report this snippet  


RSS Icon Subscribe to comments
Posted By: akahn on November 3, 2009

This is not the best way to make Haml use double quotes. Instead, use the following: Haml::Template.options[:attr_wrapper] = '"'. If you're using Haml in a Ruby on Rails application, add this to RAILS_ROOT/config/environment.rb, and then restart your application to see the change.

You need to login to post a comment.