Hi group!
i'm new to ruby and trying to include the FusionCharts in my project
error Couldn't find FactoryMaster without an ID
here's my code:
def detailed
      headers["content-type"]="text/html";
      @factory_id = params[:FactoryId]
      @factory_data = []

      factory_master = FactoryMaster. find(@factory_id)
      factory_master.factory_output_quantities.each do |
factory_output|
        date_of_production = factory_output.date_pro
        quantity_number = factory_output.quantity
        @factory_data<<
{:date_of_production=>formatted_date,:quantity_number=>quantity_number}
      end
    end

view:
<% @page_title=" FusionCharts - Database and Drill-Down Example " %>
<% @page_heading=" FusionCharts Database and Drill-Down Example " %>
<% @page_subheading="Detailed report for the factory" %>
<%str_xml = render "process_utilizations/factory_details",
{:factory_data=>@factory_data,:factory_id=>@factory_id}
        render_chart '/FusionCharts/Column2D.swf', '', str_xml,
'FactoryDetailed', 600, 300, false, false   do -%>
<% end-%>

<BR>
<a href='default?animate=0'>Back to Summary</a>
 <BR>

XML builder:
xml = ::Builder::XmlMarkup.new
xml.chart(:palette=>'2', :caption=>'Factory' + factory_id.to_s + '
Output ', :subcaption=>'(In
Units)', :xAxisName=>'Date', :showValues=>'1', :labelStep=>'2') do
        for item in factory_data
                xml.set(:label=>item[:date_of_production],:value=>item
[:quantity_number])
        end
end

thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to