Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veganstraightedge/d96bdbd9959b574d1e50f51f75ad6fe1 to your computer and use it in GitHub Desktop.
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.
<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