Found a very good article by a member of the Rails JQuery UJS core team:
Rails 3 Remote Links and Forms Part 2: Data-type (with jQuery)
http://www.alfajango.com/blog/rails-3-remote-links-and-forms-data-type-with-jquery/"jQuery’s
.ajax() method provides an optional parameter called
dataType to specify the desired data-type of the response."
So data-type defines the
response. It apparently has nothing to do with submitting data.
Since I'm trying to return a JavaScript file, I can either specify data-type = :script, or just leave it off and let it be inferred.
Still have other issues but I'm a step closer.
Mark Berry
MCB Systems
On Friday, November 16, 2012 2:45:26 PM UTC-8, mcbsys wrote:
Thanks Carlos. I was thinking it had to be dataType=JSON to properly encode the data when submitting the form. And it does work when the data is valid. It's when there are errors and I try to re-render the <div> that contains the form that I get into trouble.