Forum: Ruby on Rails Problems with validates_presence_of...anybody?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ca26b3e12e5202c3d771804afbdb1267?d=identicon&s=25 John Petterson (johnpetterson)
on 2006-03-22 08:11
Hello everybody,
I have been developing small applications in Rails from quite some time.
But lately, I came across a bug which I have not been able to correct.
If anybody could help me with it, would be of great help thankyou.

Actually, the problem is that I have a form in my application with some
set of fields.
Now what "validates_presence_of" should do is that if I submit the form
without entering the fields should raise an error.

But instead its giving me an error :

 Errno::EISDIR in Users#create

Is a directory - script/../config/../public/files/

And yes, I forgot to mention that I am also uploading a file in my
application. And that file is being stored in {RAILS_ROOT}/public/files/
If anybody could help me. Please.
Thankyou.
Ca26b3e12e5202c3d771804afbdb1267?d=identicon&s=25 John Petterson (johnpetterson)
on 2006-03-24 06:30
John Petterson wrote:
> Hello everybody,
> I have been developing small applications in Rails from quite some time.
> But lately, I came across a bug which I have not been able to correct.
> If anybody could help me with it, would be of great help thankyou.
>
> Actually, the problem is that I have a form in my application with some
> set of fields.
> Now what "validates_presence_of" should do is that if I submit the form
> without entering the fields should raise an error.
>
> But instead its giving me an error :
>
>  Errno::EISDIR in Users#create
>
> Is a directory - script/../config/../public/files/
>
> And yes, I forgot to mention that I am also uploading a file in my
> application. And that file is being stored in {RAILS_ROOT}/public/files/
> If anybody could help me. Please.
> Thankyou.

I guess this was left unnoticed.
If anybody could help.
54077fb03c95861af85880218cf7aef2?d=identicon&s=25 Gokhan Arli (sylow)
on 2006-03-24 09:59
sounds like your script trying to upload the file to
{RAILS_ROOT}/public/files/ because no file.

Have you seen file_column ? it simplifies and its own validations come
so handy http://www.kanthak.net/opensource/file_column/

Gokhan
www.sylow.net
Ca26b3e12e5202c3d771804afbdb1267?d=identicon&s=25 John Petterson (johnpetterson)
on 2006-03-25 07:08
Gokhan Arli wrote:
> sounds like your script trying to upload the file to
> {RAILS_ROOT}/public/files/ because no file.
>
> Have you seen file_column ? it simplifies and its own validations come
> so handy http://www.kanthak.net/opensource/file_column/
>
> Gokhan
> www.sylow.net

Thanks for that
But I am dobtful as to whether it will work for documents?
I am trying to upload a .doc file?
This topic is locked and can not be replied to.