Put

Rails – you think it is a POST but really it is a PUT

May 17, 2011

I just came across an odd situation in Ruby on Rails where I was working on a fairly complicated form where sometimes you displayed and were editing an existing record, but sometimes you were displaying a blank form and creating a new one. This all worked when I originally was just creating a new record each time but when I also allowed for users to update the data using the same form I hit a problem.