I have some records which I show in a view. They have start_date and end_date.
When I access the view, by default I want it only to show records who’s dates are not expired.
Expired being defined as:
- End date and start date <= Now, and
- End date is later than the start date
I then want to have a checkbox that shows all records including the ones that have been expired.
How do I approach this?
In your controller action, you want to have this somewhere:
You could also bypass all the search things and just use a scope like this: