Date formatting and adding question

Hey all,

I’m working on a site for a client that has a scedule im trying to
display that pulls the next events for the upcoming Sunday from a MySQL
table…The table stores the event date as mm/dd/yyyy. I’ve tried to
think of everyway possible to get this thing to change after every
sunday to show the next sunday’s events, but I end up doing it

Is it possible to add to and find WHERE the date in the
database equals that…might sound confusing but i’ve seen this done in
ColdFusion easily like this:

SELECT * FROM Schedule
WHERE eventdate >= #DateFormat(DateAdd(“d”, 7, Now()), “mm/dd/yy”)#

Is it possible to do something like that in RoR?

Thanks in advance!


I am not sure if I completely understand your question, but yes, you can
do arithmetics with dates. would be the beginning of the upcoming week, so would give you the next sunday. Once you
have your date you can use it as a condition in your find.

You can look it up here:


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs