date filter

Hello

You could use named_scope (starting with rails 2.1).

There is a good rails cast presenting them with an example with
dates : http://railscasts.com/episodes/108-named-scope

Tranquiliste wrote:

Hello

You could use named_scope (starting with rails 2.1).

There is a good rails cast presenting them with an example with
dates : http://railscasts.com/episodes/108-named-scope

Hi, thanks for the response.

I am wondering how to do this in my app. I can see the example code

  named_scope :recent, lambda { |time| { :conditions => ["created_at >
?", time] } }

and examples on the net state the same, but I want to be able to input
two dates into boxes and call the filter from the view page, which I
also am not sure how to do.

any help would be greatly appreciated.

dave

sorry... @articles.in_period(@start_date, @end_date)