So I know how to submit a form to a server via form_for to a model’s create and update methods, but if a model has some method foobar, how do I submit a form specifically to the foobar method? I tried specifying :method => "foobar" but that didn’t seem to do the trick. How can I submit a form_for that goes to a non-RESTful method?
EDIT:
I don’t want said method to be accessible to anyone by typing the address in their address bar. eg. www.site_name.com/controller_name/foobar should not be valid – the foobar method should solely be used for processing the submitted form.
You can use the
:urloptional parameter toform_forto specify the url you want to post to.