I have an array in my Rails 3.1 applications that made several objects:
[#<Hardware id: 10, brand_id: 5, model: "B4200", description: "Stampante OKI B4200", typology_id: 3, sub_typology_id: 10, created_at: nil, updated_at: nil>, #<Hardware id: 19, brand_id: 9, model: "JetLab", description: "JetLab - 600 ", typology_id: 5, sub_typology_id: nil, created_at: nil, updated_at: nil>]
and I want to remove one object from this array. Using the Rails console, I tried to do something like (try to delete the first object):
array.pop=#<Hardware id: 10, brand_id: 5, model: "B4200", description: "Stampante OKI B4200", typology_id: 3, sub_typology_id: 10, created_at: nil, updated_at: nil>
but that will not work. How can i do this?
UPDATED: My goal is not to call the last element in the array, but a common object (everywhere inside the array), which should be found using the mysql search query.
Marco
source share