Eric wrote:

> Use the ternary/comparison operator. I've removed your strptime stuff,
> but the idea is like so:
> 
> @from_date = params[:startdate] ? params[:startdate] : (Time.now -
> 3.months.ago)

3.months.ago is an absolute time (probably "seconds since 1970"). So the 
"Time.now -" is implied.


--~--~---------~--~----~------------~-------~--~----~
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