Topic: Date Comparison

Hi
I'm an absolute beginner to ruby and rails. I'm trying to develop a financial application. I'm done with scaffolding and most of the changes i wanted to make in the scaffolded code. there's one thing though, that i havent been able to implement.
I have a model Transaction for transactions that are made. It has a date field, for the date on which the transaction was made. I want the user to be able to select a date and then be able to see all the transactions made after that date. I've tried a few things but nothing seems to work.
Its a big step, learning a new language and a framework at the same time, while you're developing an application which you actually need to deploy. The reason I shifted to RoR was because I didn't have a lot of time. I made considerable progress in very less time but now i'm absolutely stuck.
thanks
Navjot Kukreja

Re: Date Comparison

What have you tried so far? How is the date field stored in your database?
This is probably as simple as something like

The controller that displays the list:
@transactions = Transaction.find(:all, :conditions => "date_field >= #{chosen_date}"

Where chosen_date is whatever date you're matching with.

Re: Date Comparison

Date field is stored as type date. Getting the date i want to compare with to the controller is the problem i'm facing. please tell me how do i make the view AND controller for this. with stress on how to get the desired date value to compare with to the controller.
thank you

Re: Date Comparison

thank you