From: Adam Kennedy Date: 2013-01-18T23:28:01+09:00 Subject: Re: Adding file directory automatically Yeah thanks Alex for all your help! After looking at your code, it worked fine. Brought up the correct information and also enabled me to bid on an item. However, I tried adding an if function too look something like this: if item == 'david' files = {'david' => '../Ablums/david.txt'} end As you can see, I've changed the location of the files and also the value from the form is also lowercase d for david. The reason I am trying to do this is that I have 12 text files which hold different information about music Albums, I need a function go do something like this: if item == form value change files to {'david' => '../Albums/david.txt'} else if item == form value change files to {'asher' => ../Albums/david.txt'} end (sorry for the pseudo) So I need this function to go through 12 different item names and depending on which one was submitted through the form it needs to open a different file. I keep receiving this error from my error_logs: `initialize': can't convert nil into String (TypeError), referer: http://localhost:10000/cgi-bin/david.cgi on line 14 where this is occuring, the line is File.open(files[item]) So basically it seems that my function is being skipped to line 14 then it can't find the 'files' and stops working. I know this is alot of writing and i appreciate the help alot. If you have any idea of what is going I would love to know :) Adam K -- Posted via http://www.ruby-forum.com/.