What's the best way to validate that the end date is not before the start date, and start date is after the end date in Rails?
I have this in my view controller:
<tr>
<td><%= f.label text="Starts:" %></td>
<td><%= f.datetime_select :start_date, :order => [:day, :month, :year]%></td>
</tr>
<tr>
<td><%= f.label text="Ends:" %></td>
<td><%= f.datetime_select :end_date,:order => [:day, :month, :year]</td>
</tr>
I want it to come up with a popup of sorts, with a meaningful message.
I would like to make a generic method that takes two parameters, start and end date, which I then can call in my viewcontroller ; fx
in the code above. Or, do I need to use jQuery instead?