Hi,
I am writing some simple upload functionality for an application. I can't figure out how to check if file@field is empty. Currently I am trying to use an if statement, so the post action will only occure if 'upload' is not nil. I have also tried using the .blank method with no success.

Any advice would be great.
Thanks in advance,
Jen.

If statement:
#posts to the data model.
if !:upload.nil?
    post = Upload.save(params[:upload])
puts "file uploaded"
render 'upload'
repo.commit_all('params[:message]')
else
redirect_to 'upload'
  end

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to