views:

54

answers:

1

Hello,

I am doing a validations in my model to check if a date is older than today (meaning a date can only be in future from the current time)

I was about to write down a block of code, but was wondering is there a build in function for this.

The date is passed from a view using:

<%= date_select ('load', :valid_until, :order => [:day, :month, :year]) %>

All ideas are appreciated.

+4  A: 

Yep, there's indeed a built-in date.future? method.

JRL