Haml can render
%input{:type=>"text"}
as
<input type="text">
Wonder what it should be in haml so it's rendered in html as
<input type="text" required>
Thanks
If the value of an attribute is a boolean, e.g.
%input{:type=>"text", :required => true}
it will be rendered as either
<input required type='text'>
if the format
option is :html4
or :html5
, or as
<input required='required' type='text' />
if the format is :xhtml
.
If the value is false, it will be omitted altogether:
<input type='text' />
%input{type: "text", required: true}/
or
%input{:required => "", :type => "text"}/
Source: http://www.htmltohaml.com/
%input{:required => "", :type => "text"}/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With