<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Disqus - Latest Comments for Eric Anderson</title><link>http://disqus.com/people/5190330ad8f1b06d35e2c2da73dc623c/</link><description></description><language>en</language><lastBuildDate>Thu, 05 Jun 2008 20:01:24 -0000</lastBuildDate><item><title>Re: You should be on ruby-talk</title><link>http://virtuouscode.disqus.com/you_should_be_on_ruby_talk/#comment-1471720</link><description>I also got into Ruby before Rails (although only by a period of a few months so I was still a Ruby newbie when Rails first started making news). I also have experience the "Ruby can do XYZ" with my responding "didn't everybody know that". I also enjoyed the discussion on ruby-talk for a long while. But as Ruby continues to get more popular the volume on the mailing list got so high that I couldn't keep up with it. The content is good but the volume is just too much to keep up with. Seems to be a common problem on the best newgroups. Wish there was a way to combat that volume in a sensible way.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Anderson</dc:creator><pubDate>Thu, 05 Jun 2008 20:01:24 -0000</pubDate></item><item><title>Re: Using RJS generator methods in raw JS</title><link>http://pug.disqus.com/using_rjs_generator_methods_in_raw_js/#comment-8325255</link><description>I know this post is old but thought I would post an alternate solution for anybody else that comes along this post.&lt;br&gt;&lt;br&gt;I had a very similar problem that I was solving with delay as well. It worked because the timing was right but it didn't seem elegant as it could be. Then I found the update_page helper which is great for putting JavaScript on HTML event handlers and for RJS. The following is a snippet example that will fade out some info, replace it with new info and fade it back in without using delay:&lt;br&gt;&lt;br&gt;&lt;code&gt;&lt;br&gt;display_actions = update_page do |p|&lt;br&gt;&amp;nbsp;&amp;nbsp;p.replace_html 'family-info', :partial =&amp;gt; @event&lt;br&gt;&amp;nbsp;&amp;nbsp;p.visual_effect :appear, 'family-info'&lt;br&gt;end&lt;br&gt;page.visual_effect :fade, 'family-info', :to =&amp;gt; 0.01,&lt;br&gt;&amp;nbsp;&amp;nbsp;:afterFinish =&amp;gt; "function() {#{display_actions}}"&lt;br&gt;&lt;/code&gt;&lt;br&gt;&lt;br&gt;The only thing to make this nice is to create a helper that will wrap the JavaScript in a function. Something like:&lt;br&gt;&lt;br&gt;&lt;code&gt;&lt;br&gt;def javascript_function(code)&lt;br&gt;&amp;nbsp;&amp;nbsp;"function() {#{code}}"&lt;br&gt;end&lt;br&gt;&lt;/code&gt;&lt;br&gt;&lt;br&gt;Then you can make your RJS just be:&lt;br&gt;&lt;br&gt;&lt;code&gt;&lt;br&gt;display_actions = update_page do |p|&lt;br&gt;&amp;nbsp;&amp;nbsp;p.replace_html 'family-info', :partial =&amp;gt; @event&lt;br&gt;&amp;nbsp;&amp;nbsp;p.visual_effect :appear, 'family-info'&lt;br&gt;end&lt;br&gt;page.visual_effect :fade, 'family-info', :to =&amp;gt; 0.01,&lt;br&gt;&amp;nbsp;&amp;nbsp;:afterFinish =&amp;gt; javascript_function(display_actions)&lt;br&gt;&lt;/code&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Anderson</dc:creator><pubDate>Thu, 11 Oct 2007 22:27:40 -0000</pubDate></item></channel></rss>