2011-06-15 87 views

回答

7

以同樣的方式,你在Haml的添加attributes to any other tag

%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"} 

Haml的實際上有一個built in helper method for these attributes,所以你可以這樣做:

%html{html_attrs} 

默認爲 'EN-US' 作爲語言,或者傳遞您想要使用的語言字符串:

%html{html_attrs('en')}