Answer the question
In order to leave comments, you need to log in
Slim and true in element attributes?
Hello. Slim for some reason does not store the true value in the element attributes. When false , then everything is fine and "false" is written to the value, and when true , then the empty value is "" .
Here is an example of the h1 element. Tell me please.
SLIM:
doctype html
html
head
title Testing
meta name="keywords" content="template language"
body
h1 *{ data: { enabled: true, disabled: false } } Test
<!DOCTYPE html>
<html>
<head>
<title>Testing</title>
<meta content="template language" name="keywords" />
</head>
<body>
<h1 data-disabled="false" data-enabled="">
Test
</h1>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
This is how it will work as you need
h1 *{ data: { enabled: true.to_s, disabled: false } } Test
I think this is all because of the html standard for working with boolean
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question