First of all, shed the quotes. You don't need them:
@temp = Mymodel.find_by_contents(session[:searchstr])
Second, you're not getting all models matching your search string, you're only getting one. You want:
@temp = Mymodel.find_all_by_contents(session[:searchstr])
Third, rather than deleting the records from the array after finding them, just don't find them in the first place:
@temp = Mymodel.find(:all, :conditions => ['contents = ? AND apprflag <> 0', session[:searchstr])
And finally, your variable naming is terrible! Don't abbreviate! What the hell is an apprflag? ![]()
Pete Yandell