I'm using the Simple Form gem in my Rails app. In my sign-up form, I'm have a field for birth date. However, the fields are showing in this order: Year/Month/Day.
What's the best way to get the field order Month - Day - Year?
My form looks like this:
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= f.input :created_at %>
<%= f.button :submit, "Sign up" %>
<% end %>
Are you looking for this?
<%= f.input :birthday, :order => [:month, :day, :year] %>
I don't know if it will work with simple_form, but I suspect it will... Add the following to config/locals/en.yml
(or similar):
en:
date:
order:
- :month
- :day
- :year
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