Hi team,

    I doing one rails application , i have doubt i can create user form  and
upload images ,  i did create user(using session ) and create tmp folder and
save the database  my issue is

my error is:

undefindedmeth'[]'

error came that place:

*name= Upload['imagepath'].original_filename*

please slove the problem



my code :
**********************************************
@login=Upload.new(params[:userform])
       session[:user] = Upload.new(params[:userform])
@sn= session[:user].name
@pn= session[:user].email
@ss=FileUtils.mkdir_p("tmp/session/#{@sn}")
 name= Upload['imagepath'].original_filename
directory="tmp/session/#{@sn}"
path=File.join(directory,name)
@str=directory+"/"+name

File.open(path,"wb"){|f|f.write(upload['imagepath'].read)}
   @upload=Upload.new
#@upload=ImagePath.save(params[:upload])
@upload['name']=@sn
@upload['email']=@pn
@upload['userpath']=@ss
#@upload['imagepath']=@str
#@upload=DataFile.save(params[:upload])
@upload.save
 puts "****************"
puts @sn
puts @ss
#puts @str
end
def uploadfile

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to