ActiveRecord::RecordNotFound

amarime
Thu, 27 Nov 2008 17:01:47 -0000

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-%>


Back to Summary


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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---