I thought this would be a simple task, but I'm finding it difficult to make Rails do what I want.
I've got an array of dates.
So I thought that something like this would work:
def index
@datetimes = Books.all.map(&:checkouts).flatten.map(&:out_date)
@datetimes.each do |c|
c.to_date
end
end
Then I can just call this in my view:
%ul
-@datetimes.each do |c|
%li=c
How do I modify each key in the array? What am I missing here?
Thanks, so much for being nice to new, novice, and ignorant hobbyists like myself.