Dimitar Kostov ramblings

XTHML in HAML view in Rails 3

config/initializers/haml.rb
1
Haml::Template.options[:format] = :xhtml
some_view.html.haml
1
2
3
4
5
!!! XML
!!!

-# <?xml version='1.0' encoding='utf-8' ?>
-# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Comments