Tuesday, 15 May 2012

simple form - Simple_Form and Bootstrap : input as date how to specify different width for month and year? -



simple form - Simple_Form and Bootstrap : input as date how to specify different width for month and year? -

i have date field in simple_form :

<%= f.input :dob, as: :date, start_year: date.today.year - 12, end_year: date.today.year - 110, discard_day: true, order: [:month, :year], label: "date of birth" %>

it works fine each select (month , year) has same width.

i specify different width year part, thought on how accomplish ?

cheers

you can alter in stylesheet since rails , simple_form tag input forms ids.

example. have person model , trying grab dob.

rendered snippet form partial (_form.html.erb)

<select class="date required" id="person_dob_3i" name="person[dob(3)]">

person stylesheet person.css.scss

#person_dob_3i { width: 50px; border: 1px solid #ccc; }

twitter-bootstrap simple-form

No comments:

Post a Comment