Robert,
Can you give me an example of how to do this
"The same way you always send params to your controllers. Either put them
in the query string (for GET requests) or put them in the request body
as form data (for POST or PUT requests)."
I dont know how to do this manually, usually i just always send with a rails helper.
Are you using Prototype or jQuery? In Prototype, you get the content of form elements using
var data = $F('theIdOfTheFormElement');
If you're not putting the user's data in a form field (even a hidden one) then you will need to do something hacky like
var data = $('theIdOfTheElement').innerHTML.stripTags();
Then to send it to your controller, you do something like this:
new Ajax.Request('/url/of/endpoint',{parameters:{your_rails_parameter: data}});
To do the same, but update a portion of the page with whatever HTML your Rails request returns, you substitute Updater for Request, and add the ID of the element you need to update:
new Ajax.Updater('theIdOfTheElementYouWantToUpdate', '/url/of/endpoint', {parameters:{your_rails_parameter: data}});
Note that Updater does not replace the outer box, only the contents of the box you indicate with your ID. Also, Updater does not update form fields (you can replace them, but the correct thing to do is to use Ajax.Request and a callback function onSuccess to update anything besides a DIV or another container element.
Walter