I have got a task to do knockout.js using ruby on rails. I want to send the javascript value to the controller. My index.html.erb is
<%= javascript_inclu
Just try this.
$.ajax({ url:'/employees/<%=@employee.id%>', dataType: 'json', data: { passval: dataToSave}, success: function(msg) { } });
you can use the variable passval in the ajax page for retrieving the value of dataTosave, and the variable msg will return the response from the ajax.
passval
dataTosave
msg