We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With this code:
== form action: "/", method: :post do == csrf_tag == label name: "alpha" do | beta == check_box id="beta"
I get the following html output:
<form action="/" method="post"> <input type="hidden" name="_csrf" value="..." /> <label for="alpha" id="alpha_label"> beta <input type="checkbox" name="beta" id="beta" value="1"/> <input type="hidden" name="beta" id="beta_default" value="0"/> + Alpha </label> </form>
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
The text was updated successfully, but these errors were encountered:
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"
Sorry, something went wrong.
No branches or pull requests
With this code:
I get the following html output:
<form action="/" method="post"> <input type="hidden" name="_csrf" value="..." /> <label for="alpha" id="alpha_label"> beta <input type="checkbox" name="beta" id="beta" value="1"/> <input type="hidden" name="beta" id="beta_default" value="0"/> + Alpha </label> </form>
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
The text was updated successfully, but these errors were encountered: