Data for AJAX req in Rails on the fly – solution

There is solution with Rails helper to issue from my last post. Simple use :with to pass JavaScript variable name.

remote_function (:update => 'results', 
:url => {:action => search_points}, :with => 'dataForSearch')

gives exactly what is needed:

new Ajax.Updater('results', '/route/search_points',
{asynchronous:true, evalScripts:true, parameters:dataForSearch});

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.