<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Ruby on Rails Notes &#187; ajax</title> <atom:link href="http://railsnotes.com/tag/ajax/feed/" rel="self" type="application/rss+xml" /><link>http://railsnotes.com</link> <description>A code-heavy brain dump of stuff I come across working on Ruby on Rails projects including Models, ActiveRecord, Views, Controllers, RESTful rails, deployment, server stuff, etc.</description> <lastBuildDate>Sun, 29 Aug 2010 23:45:16 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Triggering jQuery code/functions from RJS</title><link>http://railsnotes.com/289-triggering-jquery-code-functions-from-rjs/</link> <comments>http://railsnotes.com/289-triggering-jquery-code-functions-from-rjs/#comments</comments> <pubDate>Sat, 25 Apr 2009 02:32:25 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[Other]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[rjs]]></category> <category><![CDATA[views]]></category><guid
isPermaLink="false">http://www.railsnotes.com/?p=289</guid> <description><![CDATA[jQuery is an alternative to Prototype, which is the default javascript library inside Rails. Since RJS generates javascript based on prototype, you might think you can't use jQuery in it.  Although it's technically true, you can still use jQuery by using the page.call feature of RJS.]]></description> <content:encoded><![CDATA[<p></p><p>jQuery is an alternative to Prototype, which is the default javascript library inside Rails. Since RJS generates javascript based on prototype, you might think you can&#8217;t use jQuery in it.  Although it&#8217;s technically true, you can still use jQuery by using the page.call feature of RJS. Here&#8217;s an example:</p><p>## test.js</p><pre>$(function(){
  ...
};

function do_something_amazing {
  ... some slick jQuery code ...
};</pre><p>## something.rjs called using link_to_remote or form_for_remote:</p><pre>page.call 'do_something_amazing'</pre><h3>Gotcha</h3><p>A simple gotcha is if you include &#8220;function be_amazing {&#8230;};&#8221; inside the &#8220;$(function(){&#8230;};&#8221;  you&#8217;ll get an undefined error.</p><p>Credits: I came across this approach while helping shipstar in the #rubyonrails IRC channel</p><p><strong>UPDATE:</strong> Using RJS isn&#8217;t the best approach if you value unobtrusiveness. Here&#8217;s a copy/paste of some reasons why &#8220;RJS is evil&#8221;.</p><blockquote><p>dfr|work: it&#8217;s directly coupled to your dom but isn&#8217;t in it.<br
/> dfr|work: i mean, what&#8217;s rjs? it&#8217;s just a callback thing. Just specify it when you&#8217;re making ajax request.<br
/> dfr|work: and if you need the data from server, specify it via json. It&#8217;s clean and simple.</p></blockquote><p>Expect a follow-up to this explaining how to do this the right way.</p> ]]></content:encoded> <wfw:commentRss>http://railsnotes.com/289-triggering-jquery-code-functions-from-rjs/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ajax File or Image Uploading inside Ruby on Rails</title><link>http://railsnotes.com/19-ajax-file-or-image-uploading-inside-ruby-on-rails/</link> <comments>http://railsnotes.com/19-ajax-file-or-image-uploading-inside-ruby-on-rails/#comments</comments> <pubDate>Tue, 30 Sep 2008 21:48:23 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[ajax]]></category> <category><![CDATA[views]]></category><guid
isPermaLink="false">http://railsnotes.wordpress.com/?p=19</guid> <description><![CDATA[http://github.com/melvinram/ajax-image-upload/ While adding course covers to my BrainBank app, I put together a simple ruby on rails app that uses attachment_fu and responds_to_parent to upload an image. It should be useful if you&#8217;re thinking of added image uploading to your app. CREDITS http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent http://kpumuk.info/ruby-on-rails/in-place-file-upload-with-ruby-on-rails/ #rubyonrails help on observe_field by wmoxam]]></description> <content:encoded><![CDATA[<p></p><p><a
href="http://github.com/melvinram/ajax-image-upload/"><img
class="alignright" src="http://albumshaper.sourceforge.net/images/Reveal_1.2/newIcon.png" alt="" width="162" height="162" />http://github.com/melvinram/ajax-image-upload/</a></p><p>While adding course covers to my BrainBank app, I put together a simple ruby on rails app that uses attachment_fu and responds_to_parent to upload an image. It should be useful if you&#8217;re thinking of added image uploading to your app.</p><p><strong>CREDITS</strong></p><ul><li><a
href="http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent">http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent</a></li><li><a
href="http://kpumuk.info/ruby-on-rails/in-place-file-upload-with-ruby-on-rails/">http://kpumuk.info/ruby-on-rails/in-place-file-upload-with-ruby-on-rails/</a></li><li>#rubyonrails help on observe_field by <a
href="http://www.workingwithrails.com/person/5751-wesley-moxam"><span
class="Apple-style-span" style="font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;font-family:Arial;color:#000000">wmoxam</span></a></li></ul> ]]></content:encoded> <wfw:commentRss>http://railsnotes.com/19-ajax-file-or-image-uploading-inside-ruby-on-rails/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 4/16 queries in 0.528 seconds using disk

Served from: railsnotes.com @ 2010-09-10 06:00:50 -->