Drew
Drew

Reputation: 2663

Simple Form Not Respecting Input HTML

So I have the following line:

<%= f.input :birth_date, as: :date, label: "Date of Birth", html5: true, input_html: {min: Time.now.year - 100.year, max: Time.now} %>

Which is generating:

<input class="form-Field-control date required dr-FormField-control" aria-invalid="true" name="recommends_insurance_term_life_referral[birth_date]" id="recommends_insurance_term_life_referral_birth_date" type="date">

Any thoughts as to that for which I had not accounted?

Upvotes: 0

Views: 45

Answers (1)

haffla
haffla

Reputation: 1066

As min and max you have to pass a Date object.

Date.today - 100.years

Upvotes: 2

Related Questions