views:

16

answers:

0

Hi,

I have a model (Person) and an instance of this model (my_person). Now, I want to make it possible to create a new Person based on my_person. So there is a clone link, that should redirect to a form, that is prefilled with the data of my_person.

That's no problem, I used new_person = my_person.clone

My quesion is now: The form containing the cloned person wants to send the request as PUT, but I want a POST request. Why I want that? If there is an error in the form, the next request will be sent as POST automatically and I want to have a unique request for both - first submit and resubmitting in case of an error.

I know, I could reach that by using :html => { :method => :post } for the form, but that would destroy rails magic.

Why does rails automatically use the PUT request? Because there is already an ID? (It doesn't work, if I set new_person.id = nil). Any hints, what I may do, to always have a POST request for that form?

Best regards, sewid