creating intances of a model with two required foreign keys

I asked this the other day but perhaps in too wordy a way.

I have a Student model, a Course_offering model, and a Course_record
model ( a table with columns for grades in midterms, final , lab etc).

The course_record belongs_to both an instance of the Student model and
to an instance of the Course_offering model. I need to create a
collection of course_record instances with the appropriate associations
and I'd like to initialize the name attribute of course_offering to
match the name attribute of the parent Student.

Just a guess, but the fact that you aren't using the expected convention for class names isn't going to help (Those should be CourseRecord, CourseOffering)

Unfortunately what I have below isn't working. I get errors of
"Expected .\app\models\course_record.rb to define Course_record".

That usually means that either your naming has confused rails or that file contains a syntax error of some sort ( ruby -c checks a file for syntax errors)

Fred