Hello there!
I want to give the opportunity for users to indicate their age in signups_edit.html
For that I add this field:
<label for="signup_age">Age</label>{% text_field "age", class:"text" %}But that doesn't work: Liquid error: age is not a valid form field for Signup.
Even if "age" is a variable of Signup.
Ideas?
Official response from Krysta Levy
Hi Wilfried!
So, the liquid age variable can only be used to display age, not request age, because age is a variable that would be constantly changing! You can request Date of Birth, however, and the database will automatically determine a signup's age.
If you want to request Date of Birth, you can use this chunk of code:
<div class="span12"><label for="signup_born_at_chronic">Date of Birth (MM/DD/YYYY) </label>{% text_field "born_at_chronic", class:"text" %}</div>
Let us know if you have any more questions!
Share this post
Showing 8 reactions
Sign in with
User enters DD/MM date, form submits MM/DD date. Everyone wins
Thank you for the answer, I understand my mistake!
Any idea if the format DD/MM/YYYY will be supported in the future?