From: Andrew Timberlake Date: 2009-01-29T13:03:28+09:00 Subject: Re: Search for string in folder names --001636c5a82662ba89046197347e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Jan 29, 2009 at 5:58 AM, Newb Newb wrote: > Hi ... > I will be getting some string through params[:first_name].and i want to > get that > what are all the folders names contain that string. > For example > I have folders names like below > each one is folder name > > > 1.kannan@angleritech.com~Vs~joy@angleritech.com > 2.martin@angleritech.com~Vs~joy@angleritech.com > 3.martin@angleritech.com~Vs~priya@angleritech.com > > > Now if i enter "joy" into that first name text box > i want to get all the folders which has joy in the folder names > for the above example i will have to get the below results for the > folder search because it contains joy in the folder name > > kannan@angleritech.com~Vs~joy@angleritech.com > martin@angleritech.com~Vs~joy@angleritech.com > > > pls help me up how can i implemend this. > Thanks in advance > > > Cheers > -- > Posted via http://www.ruby-forum.com/. > > Dir.glob("/path/to/base/dir/*#{search_string}*") Think carefully about the security of working with input directly from user input on the file system. -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --001636c5a82662ba89046197347e--