user2951937
user2951937

Reputation:

undefined method `group_by_day' error

I want to use chartkick to make a line graph of all the user signup per day.

in my views I have

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

but it is producing that error

Upvotes: 4

Views: 1075

Answers (2)

Andrew Kane
Andrew Kane

Reputation: 3236

You need to install the groupdate gem to use the group_by_day method. I'll update the chartkick documentation to make this clearer.

Upvotes: 4

ben
ben

Reputation: 6180

try this, it can work

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

Upvotes: 0

Related Questions