trying to create a folder dir in rails.

Hello IM trying to create a folder directory based on when the user
signs up and is created Im using restful Authencation and the code i
added to the create methos is this...

Dir.mkdir"/public/midifiles/#{current_user.id}"

The public and the midi folder are allready made I just want it to
create the current_user a folder .

the Error i get is this...

No such file or directory - /public/midifiles/3

Thanks any help would be great

Gabriel

You're receiving that error because of the leading / before public -
it's treating it like an absolute path instead of a relative one. Try
this:

Dir.mkdir "#{RAILS_ROOT}/public/midifiles/#{current_user.id}"

-Dan
http://www.dcmanges.com