ActiveRecord::RecordNotFound


#1

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


#2

On Nov 27, 5:01 pm, amarime removed_email_address@domain.invalid wrote:

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]
For whatever reason, this is nil.

Fred