rails 3 uninitialized constant NameError when destroying an object -


i'm getting error in rails 3 app can't pinpoint source of... when try destroy object, following:

nameerror (uninitialized constant outcome::outcomeanalyasis): app/controllers/outcomes_controller.rb:141:in `destroy' rendered c:/ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms) rendered c:/ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (15.6ms) rendered c:/ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (15.6ms) 

this destroy function have. error because of line says @outcome.destroy.

 def destroy     @outcome = outcome.find(params[:id])      @outcome_tps = outcometimepoint.where(:outcome_id => @outcome.id).all     @outcome_subs = outcomesubgroup.where(:outcome_id => @outcome.id).all     @outcome_columns = outcomecolumn.where(:outcome_id => @outcome.id).all     @outcome_column_vals = outcomecolumnvalue.where(:outcome_id => @outcome.id).all     @outcome_results = outcomeresult.where(:outcome_id => @outcome.id).all      @outcome_tps.each {|i| i.destroy}     @outcome_subs.each {|i| i.destroy}     @outcome_columns.each {|i| i.destroy}     @outcome_column_vals.each {|i| i.destroy}     @outcome_results.each {|i| i.destroy}     @outcome.destroy  #error happens on line      respond_to |format|         @outcomes = outcome.find(:all, :conditions => {:study_id => session[:study_id]})         @study_arms = arm.find(:all, :conditions => {:study_id => session[:study_id]})             format.js {           render :update |page|                 page.replace_html 'outcomes_table', :partial => 'outcomes/table'           end         }     end   end 

there outcomeanalysis class, can't figure out it's tied outcome. i've done search on files in project directory "outcomeanalyasis" , "analyasis" both case-sensitive , non. place occurs in log file these errors.

i know somewhere within project code, have suggestions on causing this, or should look? i'm trying destroy selected @outcome object. id of @outcome object being set correctly params[:id].

i can post more code segments if help. in advance!

dude looking @ code seems first thing need use is

has_many :outcome_tps, :dependent => :destroy has_many :outcome_subs, :dependent => :destroy 

etc.... once thing let know whats problem.

it remove these lines of code

@outcome_tps = outcometimepoint.where(:outcome_id => @outcome.id).all @outcome_subs = outcomesubgroup.where(:outcome_id => @outcome.id).all @outcome_columns = outcomecolumn.where(:outcome_id => @outcome.id).all @outcome_column_vals = outcomecolumnvalue.where(:outcome_id => @outcome.id).all @outcome_results = outcomeresult.where(:outcome_id => @outcome.id).all  @outcome_tps.each {|i| i.destroy} @outcome_subs.each {|i| i.destroy} @outcome_columns.each {|i| i.destroy} @outcome_column_vals.each {|i| i.destroy} @outcome_results.each {|i| i.destroy} 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -