arrays - Calling an object in a search method in rails -
i searching through array of hashes , need find specific objects within hash. issue getting need search model. searching this...
@insur_transactions = user.transactions.find_all { |t| (t.fetch('name').downcase! =~ /user.bill.name/) }
the problem wont search hashes object found in bill.name. how pull object bill model , search specific item? using mongoid db.
got answer. since using regex can pull object using /#{ object }/ code looks this
@insur_transactions = user.transactions.find_all { |t| (t.fetch('name').downcase! =~ /#{user.bill.name}/) }
that got it!
Comments
Post a Comment