In the controller, the string you are passing in will be available in the params hash, the key being the name of the field in the form. i.e.:
<input type="text" name="my_string"/>
This would be accessible in your controller as params[:my_string]
When you say you want to update only one field, do you mean only one field in the database record, or one field on the form in the page via AJAX?
if you only want to update one field in the database:
@foo = Foo.find(params[:id])
@foo.update_attributes(:my_string => params[:my_string])
or if my_string is the only param in the params hash (other than id) you can just say
If you only want to update one field on the page via ajax you can use:
render :update do |page|
page[:id_of_field_to_update].replace_html "text to be inserted into element"
Kevin Ruscoe wrote: