Displaying 1 result from an estimated 1 matches for "items_from_sql".
2006 May 31
5
Help with sorting arrays with objects in it
...and also through a ferret
index.
I was hoping to find a way of sorting the array as i combine the two so
def advanced_search(search_text, store, format, sortby)
# find items in ferret index
items = Item.find_by_contents(search_text)
# and now find all the items from a certain store or category
items_from_sql = Item.find_by_sql("SELECT * .....")
@list = []
items.each do |i|
@list << i if items_from_sql.include?(i)
end
#now i need to sort @list somehow with sortby which would equal "title" or
"price"
??????
??????
end
Any suggestions on helping me rethink th...