Ajax POST from Javascript to Rails: How?

Hi,

I’m new to rails, and have been struggling for a while now on how to
get a simple HTTP POST working via a Prototype-based Ajax call to a
rails scaffold. I’m performing the POST as follows from javascript:

new Ajax.Request(‘object/create’, {
method: ‘post’,
parameters: {object : {url: murl, title: mtitle }},

… but my rails application doesn’t actually see any of the
parameters I’m sending (i.e. url, title).

This leads me to suspect that the way I’m formatting my parameters is
wrong, but I can’t seem to find any examples of how to do something
like this on the web. Can someone help point me in the right direction
here?

Thanks.

new Ajax.Request(‘object/create’, {
method: ‘post’,
parameters: {object : {url: murl, title: mtitle }},

Hi
There are various prototype helpers which does this job for you.
You can look at remote_form_for,submit_to_remote, etc at this section
and watch the html output generated by them

http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html

Sijo