haml może sprawićCzy haml renderowanie <input type = "text" wymagane>
%input{:type=>"text"}
jak
<input type="text">
Ciekawe, co powinno być w haml więc jest renderowane w html jak
<input type="text" required>
Dzięki
haml może sprawićCzy haml renderowanie <input type = "text" wymagane>
%input{:type=>"text"}
jak
<input type="text">
Ciekawe, co powinno być w haml więc jest renderowane w html jak
<input type="text" required>
Dzięki
Jeżeli np
%input{:type=>"text", :required => true}
będzie wyświetlany jako obu
<input required type='text'>
jeśli format
option jest :html4
lub :html5
lub jako
<input required='required' type='text' />
gdy format :xhtml
.
Jeśli wartość jest fałszywa, to zostanie całkowicie pominięte:
<input type='text' />
%input{type: "text", required: true}/
lub
%input{:required => "", :type => "text"}/
Źródło: http://www.htmltohaml.com/
%input{:required => "", :type => "text"}/
%input(type="text" required=true)
naprawdę nie, czy jest to prawidłowy sposób, ale zawsze 'wymagane: true 'dla tego rodzaju atrybutów – pjam