I have a collection of arbitrary objects that have a date attribute. I
want to display these objects by month. For example
@things=Thing.all
Now I want to display in a table all the things by month - how can I
do this? the problem isn't making a table or anything it's just the
logic for getting the min and max range for all the dates in things
and then finding the monthes to use for the scale and etc. Please give
suggestions.
I have a collection of arbitrary objects that have a date attribute. I
want to display these objects by month. For example
@things=Thing.all
Now I want to display in a table all the things by month - how can I
do this? the problem isn't making a table or anything it's just the
logic for getting the min and max range for all the dates in things
and then finding the monthes to use for the scale and etc. Please give
suggestions.
I have a collection of arbitrary objects that have a date attribute. I
want to display these objects by month. For example
@things=Thing.all
Now I want to display in a table all the things by month - how can I
do this? the problem isn't making a table or anything it's just the
logic for getting the min and max range for all the dates in things
and then finding the monthes to use for the scale and etc. Please give
suggestions.
Unlike some of the other responders, I'm going to take your "arbitray
objects" to mean that they aren't necessarily ActiveRecord models, and
therefore SQL solutions don't apply. Assuming that each of these Ruby
objects has a method date which returns either a Date, DateTime, or
Time object then something like
Thanks, this is what I was looking for.. not just a flat collection
sorted by date but sorted by date with sub objects ( I don't know how
to explain better).