Wednesday, 11 September 2013

how to delete an object's attribute from ruby array

how to delete an object's attribute from ruby array

I have a students array like this
[#<Student id: 2, admission_no: "2", gender: "m", blood_group:
"A">,#<Student id: 3, admission_no: "3", gender: "m", blood_group: "A">]
I am getting this array via named_scope .... So is there any way to select
only required attributes with named scope... I need to delete admission_no
and blood_group from this and return an array only with students id and
gender.. How is it possible. Iam using rails2.3

No comments:

Post a Comment