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!).
Written by Elia Schito
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Haml
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#