RailsCasts Pro episodes are now free!

Learn more or hide this

Paulo Arruda's Profile

GitHub User: parruda

Site: http://parruda.net

Comments by Paulo Arruda

Avatar

Hi guys,

I am new to rails. How do I make this example show the data by hour?

My database has two relevant columns: "data_time" and "values". I have a few values per hour, so, I wanted to plot them all. I was able to group by hour changing:

group("date(data_time)")

to:

group("strftime('%Y-%m-%d %H', data_time)")

But the graph still shows only per day. I suspect it has something to do with:

(start.to_date..Date.today).map do |date|

but I can't figure out what it is!