Undefined method `group_by_day 'error

I want to use chartkick to make a line graph of all users per day.

in my eyes I have

<%= line_chart User.group_by_day(:created_at).count %>

but he creates this error

+4
source share
2 answers

To use the method group_by_dayyou need to install gemdate gem. I am updating the documentation for the diagram to make this clear.

+4
source

try this it can work

<%= line_chart User.group(:created_at).count %>
0
source

All Articles