I currently have a link which when clicked calls a JavaScript function, which gathers some data and then uses ProtoType to submit a form...
function myFunction(){
data = someobject.getData();
$('myform').request({
parameters: {data:data, id:id,},
onSuccess: function(transport) {
document.location.reload();
}
});
}
...
<%= form_tag({:controller => "data", :action => "process"}, :id => "myform") %></form>
Notice my very unAJAXy document.location.reload(); in the onSuccess callback.
I want DataController#process to do this...
def process
...
render :update do |page|
page.replace 'my_div', :partial => 'test'
end
end
Can anyone guide me as to what I need to change in the calling JavaScript for page.replace to work? Right now of course, it just gets ignored.
I've tried various things, and read around, but I'm not getting what I need to do in this situation.
Thanks