A
A
Alexander Petrov2015-10-29 11:53:54
Ruby on Rails
Alexander Petrov, 2015-10-29 11:53:54

How to display items with a publication date after today?

There are table rows with publication date after today and before.
It is necessary to display all elements after today.
In fact, there are events and it is necessary to display future events on the main page.
For today I output this:

date=Date.today
      @anons=Page.where(page_id: 5, 'public_at': date )

Everything is working.
How to make a condition?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
N. Bekseitov, 2015-10-29
@Mirkom63

date=Date.today
@anons=Page.where( 'public_at > ?', date )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question