Sunday, 15 July 2012

jquery - jrails loading remote_form_tag rails -


I recently switched to jQuery using jRails for an app. All my work is 99% at the last Arjes, only except: loading => callback when using Dursth_form_tag

  & lt;% form_remote_tag: url = & gt; '/ Hostel / update_concease',: loading = & gt; Visual_effect (: appears,: load_currency),: html = & gt; {: Id = & gt; 'Currency'} =%>  

I have the hidden DIV # load_currency which provided went working prototype before using assistants perfect

But By using the new gel option, this feature does not seem to work?

I tried to use RJS and jQuery directly:

 : loading = & gt; Visual_effect (: appears ,: load_currency): loading = & gt; "$ ('# Load_currency') Show ();"  

What is this product in HTML:

  onsubmit = "jQuery.ajax ({beforeSend: function (request) {jQuery (& quot; # Load_currency & amp; quot;). FadeIn ();}, data: jQuery. ultimate (jQuery (this) .serializeArray ()) + '& amp; amp; Pramanikta_tokn =' + Ancodurik component ( 'O7Y7wzFoPPxGSTxIb2bQ3zshrUP + h1OGAUdtyzdQz0A =') , Data type: script ', type:' post ', url:' / hostels / update_currency '}); return; "& gt;  

I also tried callback: instead of: and: instead of loading: nothing else ... any thoughts? Or does this feature not only work with Jerells?

Thank you

I think the cleaner to avoid inline JavaScript and plain old You can try jquery to do something like this:

  # view.html ARB & lt;% form_tag '/ hostels / update_currency' ,: html = & gt; {: Id = & gt; 'Currency'} =%> ... # some_included_javascript_file.js $ (function () {$ ( '# currency'). Submit (function () {$ ( '# Load_currency'). Show (); // or effects $ .post (it .action, jQuery.param () () () () () (), function () {$ ('# load_currency'). Hide (); // or an effect}, 'script');} );});  

No comments:

Post a Comment