How can I generate input[type=date] with simple_form?
问题 When I do f.input :start_date, as: :date I get 3 select elements (day, month and year). I can do f.input :start_date, as: :string to get input[type=text] element, but how can I generate input[type=date] element with simple_form? 回答1: You should specify html5 option: f.input :start_date, as: :date, html5: true Here is details. 回答2: HTML 5 date / time inputs are not generated by Simple Form by default, so using date, time or datetime will all generate select boxes using normal Rails helpers. We