Created
October 24, 2021 00:24
-
-
Save veganstraightedge/d96bdbd9959b574d1e50f51f75ad6fe1 to your computer and use it in GitHub Desktop.
This is how I use a date_select or datetime_select helper in a Rails ERB view with Bootstrap classes, so it looks Bootstrappy but also all on one line.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class='mb-3'> | |
<%= form.label :birthday, class: 'form-label' %> | |
<div> | |
<%= form.date_select :birthday, | |
{ | |
prompt: true, | |
add_month_numbers: true, | |
end_year: Time.now.year - 111, | |
start_year: Time.now.year - 12, | |
}, | |
{ class: 'form-select form-select-lg d-inline w-auto' } %> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment