You can do this very easily with a named scope in your model:

named_scope :between, lambda {|start_date, end_date| {:conditions =>
["created_at BETWEEN :start AND :end", {:start => start_date, :end =>
end_date}]}}

On Apr 8, 5:51 pm, Vaibhav Deshpande <rails-mailing-l...@andreas-
s.net> wrote:
> I am very new to ruby on rails programming,
> I am using the oracle as my database,
>
> In my project there r 2 text box fields and in first and second text
> boxes i want the date field to be enter by the client and want to
> display the record between those 2 dates how can i do the same, plz be
> more specific
>
> Thanks in advance,
> Vaibhavi...
>
> Not so good not so bad
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to