This project is archived and is in readonly mode.
Ajax based actions cause js errors with synchronous calls
Reported by Niels Meersschaert | July 30th, 2008 @ 03:18 PM | in 2.x
The docs describe If you for some reason or another need synchronous processing (that‘ll block the browser while the request is happening), you can specify options[:type] = :synchronous.
If I make a call to any helper aka drop_receiving_element with type => :synchronous, the asynchronous is set as expected, but an additional argument type:synchronous is added.
Droppables.add("drop_zone", {onDrop:function(element){new Ajax.Request('/containers/dropped', {asynchronous:false, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}, type:synchronous}
This causes a js error since synchronous isn't defined as a JS variable. Alternate variations of :synchronous => true or :asynchronous => false don't work, although the docs don't say they should anyway.
Comments and changes to this ticket
-
Emilio Tagua July 31st, 2008 @ 08:12 PM
- no changes were found...
-
Emilio Tagua July 31st, 2008 @ 08:12 PM
- Tag changed from 2.1, helper to 2.1, helper, patch
I attach a patch that fix this and a few test to verify helpers are generated with the option "asynchronous" as expected.
-
josh November 22nd, 2008 @ 07:52 PM
- State changed from new to stale
Staling out, please let me know if its still an issue.
-
Emilio Tagua November 23rd, 2008 @ 12:20 AM
Hey Joshua,
I think is still an issue if the type can't be specified.
-
Emilio Tagua November 23rd, 2008 @ 01:05 AM
Josh, I was looking at the source and the patch seems to be already applied, i think you can change the state to "solved".
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>