I have a site that uses ruby (rhtml) files which I am not used to editing (more used to php). I only have access to these files to edit (so not the back-end).
In the database I have a date that I can display using:
<%= zp.date %>
which will display e.g. 14/10/2010
I can display today's date using:
<%= Date.today.strftime("%Y%m%d") %>
which will display 20160122.
What I'm trying to work out is how I can compare the dates and echo the difference and in turn display something different.
e.g.
compare <%= zp.date %> and <%= Date.today.strftime("%Y%m%d") %>.
If days difference is less than 20 echo XXX
else
If days difference between 20 - 40 echo XXX
else
If days difference between 41 - 60 echo XXX
Any help would be appreciated (links etc), code examples would be greatly appreciated.
Again to clarify I can only edit the rhtml.