problem in file uploading

Form_for is for object (when you pass activerecord object to view).
Use form_tag instead.