I am using rails 4 and making an application in which Question_sets has many Questions and Questions has many answers. Now what i want is to update one attribute of question model and one attribute of answer model through questions sets.
@question_set.questions.inspect
It gives the output
OUTPUT:
ActiveRecord::Associations::CollectionProxy
[Question id: nil, title: "werewr", question_type: "Slider", description: "ewrewrew", is_shown_in_report: false, question_set_id: nil, user_id: nil, created_at: nil, updated_at: nil]
But when i am accessing any of the attribute or trying to update it, it will give an error that is undefined "attribute_name".
can any tell how to access the attributes of the this collectionproxy object.