Open robacarp opened 6 years ago
Hi guys ! I have two ideas for this issue
Option 1
In Rails when you pass a block to a label, the name is not appended, maybe we could remove this
def label(name : String | Symbol)
content = "#{yield}"
label(name, content: content, for: name, id: "#{Kit.css_safe(name)}_label")
end
So...now we need a method to display our block, maybe we could do it somethings like this
def wrapper_field(*args)
return "" unless args.first?
args.join("")
end
in our views:
label(:name) do
wrapper_field(
check_box(:allowed),
"name"
)
Benefit: in this way you can concatenate many elements in a single method
I created a PR for it
Option 2
We could use a boolean to show the name label but this will only remove the "appends"
With this code:
I get the following html output:
When giving a block to a label, I expect the block to be the contents of the label and nothing more.
currently jasper automatically appends the name