# Creat stopped working

**URL:** <https://www.ruby-forum.com/t/creat-stopped-working/128170>\
**Category:** Rails\
**Created:** [February 5, 2008, 3:34pm UTC](https://www.ruby-forum.com/t/creat-stopped-working/128170 "2008-02-05T15:34:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankit2584](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Post date:** [February 5, 2008, 3:34pm UTC](https://www.ruby-forum.com/t/creat-stopped-working/128170/1 "2008-02-05T15:34:15Z")

</div>

Hello,  
I am trying to create a new record by writing

```
     @person = Person.new
     @person = Person.create(params[:person])
     @person.save

```

I get no error but the record does not get created in the database.  
also tried  
@person = Person.new(params[:person])

This doesnt work either.  
Same is the case for all the tables.

Strangely, all this worked before. and i pulled up a backup from my  
backup archieve and tried to run that and it worked. But the current  
program for some reason does not insert the record. It can search the  
records.  
There is no problems with the persmissions of the DB because if  
permissions were to be an issue the backup wouldnt have worked.  
Also, before i ran the backup i got an error “cannot convert nil to  
string” but after i ran the backup and switched back to my current  
project the error did not appear anymore.

Can anyone suggest me a solution for this strange behavior.  
Thank you.

---

<div class="post-metadata">

**Author:** ![ankit2584](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Post date:** [February 5, 2008, 4:05pm UTC](https://www.ruby-forum.com/t/creat-stopped-working/128170/2 "2008-02-05T16:05:30Z")

</div>

Ank Ag wrote:

> Can anyone suggest me a solution for this strange behavior.  
> Thank you.

@person.errors

---

<div class="post-metadata">

**Author:** ![ankit2584](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Post date:** [February 5, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/creat-stopped-working/128170/3 "2008-02-05T16:33:16Z")

</div>

Ilan B. wrote:

> Ank Ag wrote:
> 
> > Can anyone suggest me a solution for this strange behavior.  
> > Thank you.
> 
> @person.errors

Hi thx a lot . I found the error source. I am using attachment\_fu for  
handling images and is i create a record without an image the record is  
not created. This is because attachment\_fu needs  
content\_type,size,filename fields in the database to be filled. Any idea  
how can i proceed to create a record sometimes with and sometimes  
without an image  
Thank you.
