I am a complete newbie with Ruby and Rails. I am working on learning it
by writing a project I was going to write in PHP using Rails. I am
having a difficult time finding clear information on how I would do
I need to take a date out of a table in my database and given another
day calculate the next 28 day anniversery of the original date. This is
used to calculate a delivery schedule based on every 28 day deliveries
It is currently calculated in a spreadsheet using this method.
=B3+28 + (INT((B4-B3)/28)*28)
Where B3 is the start date(which will be pulled from a table) and B4 is
the current date (or any date in the future).
So if B3 is April 3, 2006 and B4 is January 10, 2007 it will give me
February 5, 2007.
Any tips on how I could accomplish this? I tried various methods but
they started to get long and didn’t seem to be as clean as most of the
Rails/Ruby code I’ve seen.