I have installed gem groupdate and gem chartkick and already restart my server. I'm enable to display the graph that sorted by group_by_day at my show.html.erb. I'm using postgresql database
show.html.erb
<%= @material.current_stock %>
<%= line_chart @material.group_by_day(:updated_at).sum(:current_stock) %>
controller/material_controller.rb
def show
@material = Material.find(params[:id])
end
it's working fine when I declare using the class
<%= line_chart Material.group_by_day(:updated_at).sum(:current_stock) %>
but not when I replace Material with @material.