Forum: Ruby on Rails Getting result from sql and displaying it on Gruff pie chart

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Gimzo (Guest)
on 2006-06-06 09:43
I have the following as my sql query:

@total = @report.report_items.find_by_sql "SELECT SUM(amount) FROM
report_items WHERE report_item_selected = 'y' AND available = 'n' AND
user_id = 1"

I am trying to add the value of SUM(amount) to a Gruff pie chart and it
does not seem to be working. I have the following:"Items", @total)

Does anyone know how to do this?

Thanks for your help
Gimzo (Guest)
on 2006-06-08 06:52
Problem sorted, thanks
This topic is locked and can not be replied to.