I have a ransack search form:
<h1>Scheduled Payments</h1>
<%= search_form_for [:admin, @search] do |form| %>
<%= form.text_field :start_date_gteq, value: @order_date_gteq_with_proper_format, class: "datepicker" %> to
<%= form.text_field :start_date_lteq, value: @order_date_lteq_with_proper_format, class: "datepicker" %>
<%= form.submit "Search" %>
<% end %>
I want the user to be able to type in 2 dates, and for every ScheduledPayment
record with start_date greater than or equal to the 1st text field AND start_date less than or equal to the 2nd text field to show up.
This works:
Notice that that record has a start date of 07/17/2014
. When I type 07/17/2014
in the 2nd text field, nothing shows up:
I'm guessing it's because the hours or minutes in the start_date of that record is more than +00:00:00, which is probably what is used as the default for the 2nd field. In this case how would I grab all records with start_date 07/01/2014
to 07/17/2014 23:59:59
(the absolute end of the 07/17/2014
)?