I am building a form using Ruby on Rails 4. My model has a dob
attribute that is a date
in the database. My _form.html.erb has an excerpt like this:
<div class="control-group">
<%= f.label :dob, :class => 'control-label' %>
<div class="controls">
<%= f.date_field :dob %>
</div>
</div>
For whatever reason, the HTML gets rendered as a regular input text box. Is there something being done wrong here?
Try
<%= f.date_select :dob %>
See more here on date fields.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With