This is a demo to show-case how to implement an easy date picker in rails using the simple form
gem.
You can also check my other demos.
<%= f.input :a_date, as: :date, html5: true %>
<%= f.input :a_date, as: :datetime, html5: true %>
- have a model with the date / date-time
eg.: rails g model booking restaurant:references booked_at:datetime
- create the form:
<h2>Create a new booking</h2>
<%= simple_form_for Booking.new do |f| %>
<%= f.input :booked_at, as: :datetime, html5: true %>
<%# It would work as date as well! %>
<%# f.input :booked_at, as: :date, html5: true %>
<%= f.association :restaurant %>
<%= f.submit %>
<% end %>
And we're good to go
Good Luck 🍀 and Have Fun 🤓