Created
September 16, 2015 11:51
-
-
Save smeevil/7649b617f2bc8ee03f8a to your computer and use it in GitHub Desktop.
Phoenix hidden field with boolean value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In phoenix when using a hidden field that should contain the value of a boolean with "<%= hidden_input f, :anonymous %>" it renders the following : | |
When true : | |
<input id="investment_anonymous" name="investment[anonymous]" type="hidden" value="value"> | |
When false : | |
<input id="investment_anonymous" name="investment[anonymous]" type="hidden"> | |
I would expect it to render the following : | |
When true : | |
<input id="investment_anonymous" name="investment[anonymous]" type="hidden" value="true"> | |
When false : | |
<input id="investment_anonymous" name="investment[anonymous]" type="hidden" value="false"> | |
Is this intentional or a bug ? | |
When it is intentional, then how should i handle this ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment