Database error

Hi All,

I am trying to save my form data in to table. I am able to add the data
successfully but it creates the 2 record for the single time of form
submission.

Let me explain in detail. My flow is like following:

First the user fills the form. When it submits the form, create method
will called and after completion of that it redirects to show page of
created user.

In browser it works just like I said. But, in back-end(in log), it
creates one record than redirects to the show page, than once again it
hits the create def and insert the same data in to table and again
redirects to show page.

I am using rails 2.3.5 and ruby 1.8.6

Any idea???

Smit S. wrote:

Hi All,

I am trying to save my form data in to table. I am able to add the data
successfully but it creates the 2 record for the single time of form
submission.

Let me explain in detail. My flow is like following:

First the user fills the form. When it submits the form, create method
will called and after completion of that it redirects to show page of
created user.

In browser it works just like I said. But, in back-end(in log), it
creates one record than redirects to the show page, than once again it
hits the create def and insert the same data in to table and again
redirects to show page.

I am using rails 2.3.5 and ruby 1.8.6

Any idea???

Your create method is getting called twice. A look at code would help in
resolving the issue.

Anubhaw