I'm getting an undefined method 'c' error. I'm in the students
controller, and I'm trying to find the book associated with the student,
and then take that book's id_number and assign the room's id to it and
then save the book:
def student_test
@student = (params[:id] and Student.find(params[:id])) || Student.new
run_sequence :testize
end
def test_finalize
Student.transaction do
@student.update_attributes(params[:student]) and @student.test! if
(params[:student])
room = Room.new
room.room_num = 5
room.save
c = Student.for_test && @student #@student.for_test doesn't work,
but I'm trying to apply named_scope to @student to get book associated
with the selected student.
Book.c.id_num = room.id
Book.save