sk2qha
Last Updated: February 25, 2016
·
1.26K
· elia
772edab580e030e41f9615f1d69ca95d

Plain HTML attributes in Haml

When writing some Haml tag with HTML attributes the usual way looks like this:

%meta{:content => "authenticity_token", :name => "csrf-param"}

but recent Haml releases introduced a much better syntax:

%meta(content="authenticity_token" name="csrf-param")

This way you can avoid the full-blown hash syntax when writing only a couple of static attributes (plays well with HTML copy/paste too!).

Say Thanks
Respond