Forum: Ruby on Rails ActiveRecord::RecordNotFound

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B706d3dd5f7ef1f7aa227aeecf74871a?d=identicon&s=25 Amari Amari (amarime)
on 2008-11-27 18:02
(Received via mailing list)
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
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-11-27 18:24
(Received via mailing list)
On Nov 27, 5:01 pm, amarime <amar...@gmail.com> 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
This topic is locked and can not be replied to.