Simple file upload help


I’m trying to implement the simple file upload example at

However, I’m getting an error “No such file or directory” when I
submit the form…

Errno::ENOENT in Admin/websites#create
No such file or directory - /images/websites/websitename.jpg

I believe it’s relating to the code in the model:

def"/images/websites/#{website[‘name’]}.jpg", “w”) { |f|
f.write(website[‘filename’].read) }

From what I understand it is trying to open the file at
/images/websites/websitename.jpg which doesn’t exist. I’m not entirely
sure how this file upload is supposed to work, but essentially I just
want a simple upload that places a file into that location from my
public directory.

Any help would be greatly appreciated,