I just had the opportunity to update my code, this works very nicely. Thank 
you very much!

Jim

On Thursday, December 3, 2015 at 6:01:28 PM UTC-8, Sergio Cambra wrote:
>
> I'm adding a ActiveScaffold.reload_embedded('selector') method with your 
> code to master.
>
>  
>
> El 04-12-2015 2:54, Sergio Cambra escribió:
>
> Nice you find out a solution.
>
>  
>
> My line was missing a .replace('embedded=true', ''), reload needs to 
> remove embedded parameter from url.
>
>  
>
> El 03-12-2015 0:59, Jim escribió:
>
> On Wednesday, December 2, 2015 at 1:50:08 AM UTC-5, Sergio Cambra wrote:
>
>> I think there is no method for that, but div for embedded scaffolds have 
>> data-refresh attribute:
>>
>>  
>>
>> <div class="active-scaffold-component" 
>> data-refresh="/controller?eid=...&amp;embedded=true" id="...">
>>
>>  
>>
>> So, you can use this:
>>
>>  
>>
>> ActiveScaffold.reload($('selector for embedded').data('refresh'));
>>
>  
> That sends a request that returns the appropriate html in the response, 
> but does not actually update the content that appears on the page. So I dug 
> into the ActiveScaffold jquery javascript and saw that reload just calls 
> jquery's getScript function, but since HTML is returned and not javascript 
> then it doesn't do anything. A little digging into load_embedded showed me 
> the correct path.
>  
> var embedded = $('selector for embedded');
> embedded.load(embedded.data('refresh'), function() {
> $(this).trigger('as:element_updated');
> });
>  
> Clean and simple! Thanks for your help.
>  
> Jim Crate
>  
>
>  
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ActiveScaffold : Ruby on Rails Gem" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at http://groups.google.com/group/activescaffold.
> For more options, visit https://groups.google.com/d/optout.
>
>  
>  
>
>  
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "ActiveScaffold : Ruby on Rails Gem" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at http://groups.google.com/group/activescaffold.
> For more options, visit https://groups.google.com/d/optout.
>
>  
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to