Forum: Ruby on Rails Show text or image, based on data value

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Remco S. (Guest)
on 2009-04-02 19:39

I have a table sales with the columns, title, short_description,
long_description, start_date, end_date. The columns start_date end
end_date has both a date value.

My sales record are show on a index-page, with the start_date and
end_date published.

I want on the index-page a "timer" based on end_date. By example today
it is 2 april and a sales availability end_date is 4 april, i want to
show to the consumer "You only have 2 days left" or a image(2.gif) with
text in the same context..

I am newbie...someone suggestions/links?

Phillip (Guest)
on 2009-04-03 19:23
(Received via mailing list)
Use date comparison functions (DATEDIFF, CURRENT_DATE) in your
database query.

On Apr 2, 11:39 am, Remco S. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.