Expected ... to define

Hi Jonathan,

Jonathan Towell wrote:

Here is the error:

Expected ./app/models/lab_result.rb to define Lab_result

`const_missing' #{RAILS_ROOT}/app/controllers/visit_controller.rb:72:in `delete_lab'

Here is the method causing causing the error:

def delete_lab @lab_result = Lab_result.find(params[:id])

Here is the Lab_result model sitting comfortably in the models dir:

class LabResult < ActiveRecord::Base

The find occurs on the model. You're using some sort of combination of the model class and the model class file name. Try:

@lab_result = LabResult.find(params[:id])

hth, Bill