开发者

Preserve attribute ordering in Haml

开发者 https://www.devze.com 2023-04-10 13:26 出处:网络
If I create an XML element in HAML: %tag{:b => \"b\", :a开发者_C百科 => \"a\"} I get this output:

If I create an XML element in HAML:

%tag{:b => "b", :a开发者_C百科 => "a"}

I get this output:

<tag a="a" b="b"/>

Is it possible to keep the ordering of the attributes in HAML?

I need this for a client-side code to display values in certain order and don't want to pass extra information on the client just to maintain ordering.


It's not possible with HAML because it's a hash.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号