Hi
I have this kind of code source for uplaodin an image. from controller: def uploadFile @text = "File has been uploaded successfully"
post = DataFile.save(params[:upload]) render :text => @text
end
from model: def self.save(upload) name = upload['datafile'].original_filename directory = "public/data" #Creating the file path path = File.join(directory, name) #write the file File.open(path,"wb"){ |f| f.write(upload['datafile'].read) } end
But variable upload should be sent on array in new version. If i wan't to go through that array what is the easist way. Do i have to do just loop. I am newbie on rails so i am lit bit confused about the dynamic variables.