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:
@student = (params[:id] and Student.find(params[:id])) || Student.new
@student.update_attributes(params[:student]) and @student.test! if
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
named_scope :for_test, :include => :book, :conditions => [:first,
“book.location_id == site_id”]
The idea is to find the book associated with the student via the
location and then pass the room id into that book’s id_num.
Thanks for any response.