NOTE: although demonstrated using helpers, I believe this is a prototype bug.
In a restful application, observe_form is used to submit using the post method as follows.
observe_form('my_form', story_subscription_path(:id => nil), :method => :post, :with => 'value=value')
Mongrel logs show that the create action is called on the StorySubscriptions controller, with the following parameters:
{"story_subscription"=>{"continue_page_i_follow"=>"1", "continue_page_i_wrote"=>"1"}, "action"=>"create", "controller"=>"story_subscriptions"}
Now, I want to submit to the update action instead. The controller is RESTful, so I need to do so using PUT. The observe_form call is changed to:
observe_form('my_form', story_subscription_path(:id => @story_subscription), :method => :put, :with => 'value=value')
Mongrel logs the following:
Parameters: {"action"=>"update", "id"=>"1", "controller"=>"story_subscriptions"}
I've tried the same with using the javascript Form.Observer directly. Same result, hence the bug is probably in prototype. Also tried a seperate observe_field for each field, again with the same result.