<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Luca Guidi weblog</title>
    <link>http://lucaguidi.com/articles</link>
    <pubDate>Thu, 18 Jun 2009 08:58:48 GMT</pubDate>
    <description>Luca Guidi weblog</description>
    <geo:lat>41.86</geo:lat><geo:long>12.49</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/LucaGuidi" type="application/rss+xml" /><feedburner:emailServiceId>LucaGuidi</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Rails: Unobtrusive and i18n Javascript confirm</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/K3MccWYlbfQ/rails-unobtrusive-and-i18n-javascript-confirm</link>
      <description>&lt;p&gt;How many times do you heard you should &lt;strong&gt;separate content from behavior&lt;/strong&gt;? Never? Hmmm don't try to cheat me.. So, why do you still use &lt;code&gt;:confirm&lt;/code&gt; option for &lt;code&gt;link_to&lt;/code&gt; helper?&lt;/p&gt;

&lt;p&gt;Here a little snippet to archive our goal, and as extra bonus, you get it i18n:
&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; //&amp;lt;![CDATA[
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; window._ authenticity_token = &amp;quot;&amp;lt;%= form_authenticity_token %&amp;gt;&amp;quot;;
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; //]]&amp;gt;
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; &amp;lt;/script&amp;gt;
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt; &amp;lt;%= link_to t(:'delete'), asset_path(@asset),
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt;       :title          =&amp;gt; t(:'asset.destroy'),
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt;       :class          =&amp;gt; &amp;quot;delete&amp;quot;,
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt;       :'data-confirm' =&amp;gt; t(:'asset.destroy_confirm') %&amp;gt;
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Keyword"&gt;$&lt;/span&gt;(&lt;span class="Support"&gt;document&lt;/span&gt;).ready(&lt;span class="Storage"&gt;function&lt;/span&gt;(){
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt;   &lt;span class="Keyword"&gt;$&lt;/span&gt;(&lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;.delete&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).bind(&lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;click&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="Storage"&gt;function&lt;/span&gt;() {
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt;     &lt;span class="Keyword"&gt;if&lt;/span&gt;(&lt;span class="Support"&gt;window&lt;/span&gt;.&lt;span class="SupportFunction"&gt;confirm&lt;/span&gt;(&lt;span class="Keyword"&gt;$&lt;/span&gt;(&lt;span class="Variable"&gt;this&lt;/span&gt;).attr(&lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;data-confirm&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;))) {
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt;       &lt;span class="Keyword"&gt;$&lt;/span&gt;.ajax({
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt;         url: &lt;span class="Keyword"&gt;$&lt;/span&gt;(element).attr(&lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;href&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;),
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt;         data: {
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt;           _method: &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;delete&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;,
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt;           authenticity_token: &lt;span class="Support"&gt;window&lt;/span&gt;._authenticity_token
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt;         },
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt;         type: &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;post&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;,
&lt;span class="line-numbers"&gt;  11 &lt;/span&gt;         dataType: &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;script&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  12 &lt;/span&gt;       });
&lt;span class="line-numbers"&gt;  13 &lt;/span&gt;     }
&lt;span class="line-numbers"&gt;  14 &lt;/span&gt;     &lt;span class="Keyword"&gt;return&lt;/span&gt; &lt;span class="Constant"&gt;false&lt;/span&gt;;
&lt;span class="line-numbers"&gt;  15 &lt;/span&gt;   });
&lt;span class="line-numbers"&gt;  16 &lt;/span&gt; });
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;
Ok, first of all, I'm using &lt;strong&gt;jQuery&lt;/strong&gt;. When the DOM is ready I'm going to bind all the elements with the &lt;code&gt;delete&lt;/code&gt; class to the &lt;code&gt;click&lt;/code&gt; event. When a user clicks on the link, it will use the &lt;strong&gt;HTML5&lt;/strong&gt; &lt;a href="http://ejohn.org/blog/html-5-data-attributes/"&gt;custom attribute&lt;/a&gt; &lt;code&gt;data-confirm&lt;/code&gt; as window confirmation content.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cmWxd6WeEGA2b-7tHNAykpYZj9M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cmWxd6WeEGA2b-7tHNAykpYZj9M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cmWxd6WeEGA2b-7tHNAykpYZj9M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cmWxd6WeEGA2b-7tHNAykpYZj9M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=K3MccWYlbfQ:vz57iKge7y4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=K3MccWYlbfQ:vz57iKge7y4:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=K3MccWYlbfQ:vz57iKge7y4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=K3MccWYlbfQ:vz57iKge7y4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=K3MccWYlbfQ:vz57iKge7y4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=K3MccWYlbfQ:vz57iKge7y4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Thu, 18 Jun 2009 08:58:48 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/06/17/rails-unobtrusive-and-i18n-javascript-confirm</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/06/17/rails-unobtrusive-and-i18n-javascript-confirm</feedburner:origLink></item>
    <item>
      <title>Memoria: Statistics for Redis</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/62_A7QVEH3M/memoria-statistics-for-redis</link>
      <description>&lt;p&gt;A couple of days ago &lt;a href="http://twitter.com/jodosha/status/2117046130"&gt;I setup this blog&lt;/a&gt; with &lt;a href="http://code.google.com/p/redis/"&gt;Redis&lt;/a&gt; as cache container, thanks to my Ruby gem: &lt;a href="http://github.com/jodosha/redis-store"&gt;redis-store&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, following the old &lt;em&gt;itch-your-own-scratches&lt;/em&gt; rule, I created a little &lt;a href="http://www.sinatrarb.com"&gt;Sinatra&lt;/a&gt; statistics web application for Redis statistics: &lt;a href="http://github.com/jodosha/memoria"&gt;Memoria&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img.skitch.com/20090613-nqmj7guc6n8ptwt3bgsbuipuw7.jpg" width="446px" heigth="330px" alt="Memoria screenshot"&gt;&lt;/p&gt;

&lt;h1&gt;Getting Started&lt;/h1&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; (sudo) gem install sinatra dm-core do_sqlite3 rspec
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; (sudo) gem install ezmobius-redis-rb jodosha-memoria -s http://gems.github.com
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; memoria /path/to/installation
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; cd /path/to/installation
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; cp memoria.yml.example memoria.yml
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; rackup config.ru --port 9292 mongrel
&lt;/pre&gt;&lt;p&gt;Memoria is still in an &lt;em&gt;embryonic stage&lt;/em&gt;, feel free to suggest features.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EjnZ6A8mnYw9t4AMZJvUlrHaOiA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EjnZ6A8mnYw9t4AMZJvUlrHaOiA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EjnZ6A8mnYw9t4AMZJvUlrHaOiA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EjnZ6A8mnYw9t4AMZJvUlrHaOiA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=62_A7QVEH3M:YBSXWMrN_VY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=62_A7QVEH3M:YBSXWMrN_VY:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=62_A7QVEH3M:YBSXWMrN_VY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=62_A7QVEH3M:YBSXWMrN_VY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=62_A7QVEH3M:YBSXWMrN_VY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=62_A7QVEH3M:YBSXWMrN_VY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Sat, 13 Jun 2009 15:39:47 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/06/13/memoria-statistics-for-redis</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/06/13/memoria-statistics-for-redis</feedburner:origLink></item>
    <item>
      <title>Hanoi: Automated jQuery tests with QUnit</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/eKiW5p2Yt1A/hanoi-automated-jquery-tests-with-qunit</link>
      <description>&lt;p&gt;About a month ago, we have released &lt;a href="http://adva-cms.org"&gt;adva-cms&lt;/a&gt; 0.2.0, the &lt;a href="http://adva-cms.org/2009/4/28/out-now-adva-cms-0-dot-2-0-the-usability-release"&gt;most relevant change&lt;/a&gt; was the migration from &lt;a href="http://prototypejs.org"&gt;Prototype&lt;/a&gt; to &lt;a href="http://jquery.com"&gt;jQuery&lt;/a&gt;. I always been a loyal Prototype fan, and, until then, I always tested my code with &lt;code&gt;unittest.js&lt;/code&gt;, combined with &lt;code&gt;jstest.rb&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Like other rewrite we needed to rely on a solid test layer, but what I noticed was the lack of a valid automation support for &lt;strong&gt;QUnit&lt;/strong&gt;, the test framework used internally by the jQuery team. So, in a couple of days I built what we need, just creating a custom version of &lt;code&gt;jstest.rb&lt;/code&gt; and changing a little bit QUnit, in order to communicate with it.&lt;/p&gt;

&lt;p&gt;Now I extracted a the general purpose code for testing other JavaScript projects, the result is &lt;strong&gt;&lt;a href="http://github.com/jodosha/hanoi"&gt;Hanoi&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hanoi needs a working &lt;a href="http://rake.rubyforge.org"&gt;Rake&lt;/a&gt; installation and it's capable to test your JavaScript code, &lt;strong&gt;collecting the results inside the shell&lt;/strong&gt;. It currently supports &lt;strong&gt;assets&lt;/strong&gt;, and &lt;strong&gt;fixtures&lt;/strong&gt;, and it's pretty easy to use.&lt;/p&gt;

&lt;p&gt;First of all you need to install the gem:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; (sudo) gem install jodosha-hanoi -s http://gems.github.com
&lt;/pre&gt;&lt;p&gt;Then you have to initialize your project path, with the &lt;code&gt;hanoi&lt;/code&gt; executable:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; hanoi /path/to/project
&lt;/pre&gt;&lt;p&gt;Now, you can easily run the test suite:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; rake test:js
&lt;/pre&gt;&lt;p&gt;You can find more details on the &lt;a href="http://github.com/jodosha/hanoi"&gt;GitHub&lt;/a&gt; page.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/f2XM8FGGlmEU_3seNS-lw_soSXI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f2XM8FGGlmEU_3seNS-lw_soSXI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/f2XM8FGGlmEU_3seNS-lw_soSXI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f2XM8FGGlmEU_3seNS-lw_soSXI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=eKiW5p2Yt1A:blLfmKa0mto:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=eKiW5p2Yt1A:blLfmKa0mto:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=eKiW5p2Yt1A:blLfmKa0mto:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=eKiW5p2Yt1A:blLfmKa0mto:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=eKiW5p2Yt1A:blLfmKa0mto:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=eKiW5p2Yt1A:blLfmKa0mto:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Tue, 09 Jun 2009 14:17:16 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/06/09/hanoi-automated-jquery-tests-with-qunit</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/06/09/hanoi-automated-jquery-tests-with-qunit</feedburner:origLink></item>
    <item>
      <title>Click To Globalize for Rails 2.3</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/6w55uLx-zSw/click-to-globalize-for-rails-23</link>
      <description>&lt;p&gt;As announced in my &lt;a href="http://lucaguidi.com/2009/03/12/status-of-my-open-source-projects"&gt;previous post&lt;/a&gt; I'm working to update my Open Source projects. Today's the time of &lt;a href="http://lucaguidi.com/projects/click-to-globalize"&gt;&lt;strong&gt;Click to Globalize&lt;/strong&gt;&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;For all of you who don't know what I'm talking about, &lt;strong&gt;Click to Globalize&lt;/strong&gt; is a Rails plugin for in-place translations. Now it's compatible with Rails 2.3 and It's also the most clean and polish version of ever, let me explain what's changed.&lt;/p&gt;

&lt;h1&gt;Engine&lt;/h1&gt;

&lt;p&gt;Yes, &lt;strong&gt;Click to Globalize&lt;/strong&gt; is now an &lt;a href="http://rails-engines.org/"&gt;engine&lt;/a&gt;, this means all the controllers, the helpers, the routes and the other stuff, now lives in &lt;code&gt;vendor/plugins&lt;/code&gt;. No more clutter with flying files, except for one javascript and one stylesheet.&lt;/p&gt;

&lt;h1&gt;I18n&lt;/h1&gt;

&lt;p&gt;The &lt;a href="http://i18n-rails.org/"&gt;i18n team&lt;/a&gt; (myself included) worked hard to build a &lt;strong&gt;consistent API&lt;/strong&gt; for i18n. Starting from Rails 2.2 we have bundled a gem for this purpose, and now my plugin is totally compliant with this system, this &lt;strong&gt;agnosticism&lt;/strong&gt; allow you to use whatever i18n backend you want. Click to Globalize is &lt;strong&gt;no longer a Globalize extension!!&lt;/strong&gt;  &lt;/p&gt;

&lt;h1&gt;RESTful&lt;/h1&gt;

&lt;p&gt;The plugin now bundles two &lt;strong&gt;full RESTful&lt;/strong&gt; controllers: &lt;code&gt;TranslationsController&lt;/code&gt; and &lt;code&gt;LocalesController&lt;/code&gt;, respectively &lt;code&gt;/translations&lt;/code&gt; and &lt;code&gt;/locales&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;Lightweight&lt;/h1&gt;

&lt;p&gt;I replaced the annoying &lt;code&gt;around_filter&lt;/code&gt; system, with a more lightweight one, based on the observation of &lt;code&gt;ActionView#render&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;Formatting&lt;/h1&gt;

&lt;p&gt;I removed the support for &lt;strong&gt;Markdown&lt;/strong&gt; and &lt;strong&gt;Textile&lt;/strong&gt;, personally I never used so much, and don't think they are so related with i18n.&lt;/p&gt;

&lt;h1&gt;Deprecations&lt;/h1&gt;

&lt;p&gt;The old &lt;code&gt;globalize?&lt;/code&gt; method is deprecated in favor of &lt;code&gt;in_place_translations?&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;You can find all the new instructions to the &lt;a href="http://lucaguidi.com/projects/click-to-globalize"&gt;project page&lt;/a&gt; or on &lt;a href="http://github.com/jodosha/click-to-globalize"&gt;GitHub&lt;/a&gt;.&lt;br/&gt;
Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hPgoGmlFWwxMAgkFROl2ASC-_80/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hPgoGmlFWwxMAgkFROl2ASC-_80/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hPgoGmlFWwxMAgkFROl2ASC-_80/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hPgoGmlFWwxMAgkFROl2ASC-_80/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=6w55uLx-zSw:lft_nsi0bVE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=6w55uLx-zSw:lft_nsi0bVE:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=6w55uLx-zSw:lft_nsi0bVE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=6w55uLx-zSw:lft_nsi0bVE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=6w55uLx-zSw:lft_nsi0bVE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=6w55uLx-zSw:lft_nsi0bVE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Fri, 10 Apr 2009 18:58:22 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/04/10/click-to-globalize-for-rails-23</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/04/10/click-to-globalize-for-rails-23</feedburner:origLink></item>
    <item>
      <title>Boost Rails Sessions</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/diF07mkYZ7E/boost-rails-sessions</link>
      <description>&lt;p&gt;There are many dark corners and hidden features in a big framework like &lt;strong&gt;Rails&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;Digging inside the code of &lt;strong&gt;ActiveRecord&lt;/strong&gt; I discovered an interesting class: &lt;strong&gt;SqlBypass&lt;/strong&gt;. When you set your session store on ActiveRecord it will use a &lt;strong&gt;Base&lt;/strong&gt; subclass for deal with database store. This configuration adds an useless overhead for your application, because each session read/write will go through the complex callbacks system of ActiveRecord.  &lt;/p&gt;

&lt;p&gt;For these reason is highly advisable to use &lt;strong&gt;SqlBypass&lt;/strong&gt;. As the name suggest it bypasses all the callbacks and simply performs read/write operations.&lt;/p&gt;

&lt;h2&gt;Try It By Yourself&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;session_store.rb&lt;/code&gt;:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; config/initializers/session_store.rb&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; &lt;span class="Support"&gt;ActionController&lt;/span&gt;::&lt;span class="Entity"&gt;Base&lt;/span&gt;.&lt;span class="Entity"&gt;session_store&lt;/span&gt; &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;active_record_store&lt;/span&gt;
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; &lt;span class="Support"&gt;ActiveRecord&lt;/span&gt;::&lt;span class="Entity"&gt;SessionStore&lt;/span&gt;.&lt;span class="Entity"&gt;session_class&lt;/span&gt; &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Support"&gt;ActiveRecord&lt;/span&gt;::&lt;span class="Entity"&gt;SessionStore&lt;/span&gt;::&lt;span class="Variable"&gt;SqlBypass&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;.. then in &lt;code&gt;session_controller.rb&lt;/code&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; app/controllers/session_controller.rb&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; &lt;span class="Keyword"&gt;class&lt;/span&gt; &lt;span class="Entity"&gt;SessionController&lt;span class="EntityInheritedClass"&gt; &lt;span class="EntityInheritedClass"&gt;&amp;lt;&lt;/span&gt; ApplicationController&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt;   &lt;span class="Keyword"&gt;def&lt;/span&gt; &lt;span class="Entity"&gt;read&lt;/span&gt;
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt;     render &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;text&lt;/span&gt; =&amp;gt; session[&lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;user_id&lt;/span&gt;], &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;status&lt;/span&gt; =&amp;gt; &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;ok&lt;/span&gt;
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt;   &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt;   &lt;span class="Keyword"&gt;def&lt;/span&gt; &lt;span class="Entity"&gt;write&lt;/span&gt;
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt;     render &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;text&lt;/span&gt; =&amp;gt; session[&lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;user_id&lt;/span&gt;] &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="Constant"&gt;23&lt;/span&gt;, &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;status&lt;/span&gt; =&amp;gt; &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;ok&lt;/span&gt;
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt;   &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt; &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;I ran raw benchmarks with one Mongrel instance in production mode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;read:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Session: 93.05 reqs/sec&lt;/li&gt;
&lt;li&gt;SqlBypass: 132.78 reqs/sec&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;write:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Session: 99.89 reqs/sec&lt;/li&gt;
&lt;li&gt;SqlBypass: 128.17 reqs/sec&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find the whole benchmark results at the dedicated &lt;a href="http://gist.github.com/88239"&gt;gist&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Unfortunately there is a bug in &lt;strong&gt;SqlBypass&lt;/strong&gt;, just apply &lt;a href="http://bit.ly/FGiaD"&gt;this patch&lt;/a&gt; for make it working.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_jwUOqWLCYcmqu55SGIxhb-dfQM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_jwUOqWLCYcmqu55SGIxhb-dfQM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_jwUOqWLCYcmqu55SGIxhb-dfQM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_jwUOqWLCYcmqu55SGIxhb-dfQM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=diF07mkYZ7E:eOmFOdlRyLo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=diF07mkYZ7E:eOmFOdlRyLo:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=diF07mkYZ7E:eOmFOdlRyLo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=diF07mkYZ7E:eOmFOdlRyLo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=diF07mkYZ7E:eOmFOdlRyLo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=diF07mkYZ7E:eOmFOdlRyLo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Tue, 31 Mar 2009 16:05:48 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/03/31/boost-rails-sessions</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/03/31/boost-rails-sessions</feedburner:origLink></item>
    <item>
      <title>Vanilla!</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/wt3MEqB_O-w/vanilla</link>
      <description>&lt;p&gt;&lt;img src="http://farm4.static.flickr.com/3663/3385004567_3da74df0b7.jpg" alt="blog screenshot" title="Vanilla! screenshot"/&gt;  &lt;/p&gt;

&lt;p&gt;I'm really proud to announce that now this blog is running on a custom application called &lt;strong&gt;Vanilla!&lt;/strong&gt;.&lt;br/&gt;
I worked on it about for two weeks, in the evening. Yes, this is the &lt;strong&gt;power&lt;/strong&gt; of &lt;strong&gt;Ruby on Rails&lt;/strong&gt;! :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LQcfwEuiGSjxkDpYRmX5vKzdgkA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LQcfwEuiGSjxkDpYRmX5vKzdgkA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LQcfwEuiGSjxkDpYRmX5vKzdgkA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LQcfwEuiGSjxkDpYRmX5vKzdgkA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=wt3MEqB_O-w:3IHMui7LDFM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=wt3MEqB_O-w:3IHMui7LDFM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=wt3MEqB_O-w:3IHMui7LDFM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=wt3MEqB_O-w:3IHMui7LDFM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=wt3MEqB_O-w:3IHMui7LDFM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=wt3MEqB_O-w:3IHMui7LDFM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Thu, 26 Mar 2009 09:48:09 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/03/26/vanilla</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/03/26/vanilla</feedburner:origLink></item>
    <item>
      <title>Status of my Open Source projects</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/sXY5zwSZJUU/status-of-my-open-source-projects</link>
      <description>&lt;p&gt;
  Starting an open source project is like to adopt a child, it takes time and cure, and, in general, you should help it to grow up.&lt;br /&gt;
  But we are human, and often we don't pay enough attention to our children, so, the more faster the environment where they live evolves, the less they are useful.
  A great and paradoxical example is &lt;a href="http://lucaguidi.com/pages/click-to-globalize"&gt;Click to Globalize&lt;/a&gt;: I ideated it, created, developed, presented at &lt;a href="http://lucaguidi.com/2007/11/1/rails-to-italy-report"&gt;Rails to Italy&lt;/a&gt; and at &lt;a href="http://railsconfeurope.com/"&gt;Euro RailsConf&lt;/a&gt;, but still &lt;strong&gt;not compatible&lt;/strong&gt; with Rails 2.2.x! And I contributed both to the 2.2.x branch and with the &lt;a href="http://rails-i18n.org"&gt;rails-i18n&lt;/a&gt; team!
&lt;/p&gt;

&lt;p&gt;I felt guilty in the past months, for turning from my projects, but the answer was: the OSS ecosystem will survive, and if a project is unmaintained it will be forked (if worthy) or it will die. And it was my excuse for spend time with music or photography, and to the other stuff I like to call &lt;em&gt;analogue life&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;
  I believe that hiatus could be a good thing if it helps the author of a project to understand and focus on the direction the project should take.&lt;br /&gt;
  I love Open Source it made me a better programmer, and now it's time to be honest with myself and with the Community and decide which project will be maintained.
&lt;/p&gt;

&lt;p&gt;
  So, here my plans:&lt;br /&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;a href="http://lucaguidi.com/pages/click-to-globalize" title="Click to Globalize"&gt;Click to Globalize&lt;/a&gt;: it's most used and well-known project of mine, it will be &lt;strong&gt;compatible&lt;/strong&gt; with the new &lt;a href="http://github.com/svenfuchs/i18n"&gt;i18n API&lt;/a&gt;, it will be &lt;strong&gt;framework agnostic&lt;/strong&gt; and I'm working to avoid the &lt;code&gt;around_filter&lt;/code&gt; technique.&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://lucaguidi.com/pages/sashimi" title="Sashimi"&gt;Sashimi&lt;/a&gt;: I will fix svn and git issues, and make &lt;strong&gt;compatible with Ruby 1.9.1&lt;/strong&gt;. Probably I will rewrite a part of it and &lt;strong&gt;cover with rSpec&lt;/strong&gt;. It was my pilot project for Ruby gems, Open Source activities and it will survive :)&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://lucaguidi.com/pages/assets_packager" title="Assets Packager"&gt;Assets Packager&lt;/a&gt;: it's very tiny and very useful for me, I recently made compatible with Sprockets. A survivor.&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://lucaguidi.com/pages/acts-as-resource" title="Acts As Resource"&gt;Acts As Resource&lt;/a&gt;: it's my first Rails plugin, I'm really proud of it, but never used and it will die. Maybe it could be useful for &lt;a href="http://github.com/rails/rails/tree/master/activemodel" title="ActiveModel"&gt;ActiveModel&lt;/a&gt; contributions.&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://lucaguidi.com/pages/nested_models" title="Nested Models"&gt;Nested Models&lt;/a&gt;: no longer needed, due to the merge with the great patch by &lt;a href="http://github.com/alloy"&gt;Eloy Duran&lt;/a&gt;, available in Rails 2.3.&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://github.com/jodosha/plugin_migrations" title="Plugin Migrations"&gt;Plugin Migrations&lt;/a&gt;: I'm waiting for the adoption of &lt;a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2058"&gt;my patch&lt;/a&gt;, if not released with Rails 2.3, I will continue to maintain.&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://lucaguidi.com/pages/cached_models" title="Cached Models"&gt;Cached Models&lt;/a&gt;: last but not least. I'm really really really proud of this plugin. It has been mentioned by &lt;a href="http://www.railsenvy.com/2008/9/17/rails-envy-podcast-episode-047-09-17-2008"&gt;RailsEnvy #047&lt;/a&gt;, but I didn't received the feedback I expected. Since it's a really expensive, hard-to-maintain project, I'll soon decide about its destiny.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VKf9QLEa8xDdi_OuXXluQO2zwXs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VKf9QLEa8xDdi_OuXXluQO2zwXs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VKf9QLEa8xDdi_OuXXluQO2zwXs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VKf9QLEa8xDdi_OuXXluQO2zwXs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=sXY5zwSZJUU:khP88WzT1zg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=sXY5zwSZJUU:khP88WzT1zg:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=sXY5zwSZJUU:khP88WzT1zg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=sXY5zwSZJUU:khP88WzT1zg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=sXY5zwSZJUU:khP88WzT1zg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=sXY5zwSZJUU:khP88WzT1zg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Wed, 25 Mar 2009 18:54:17 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/03/12/status-of-my-open-source-projects</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/03/12/status-of-my-open-source-projects</feedburner:origLink></item>
    <item>
      <title>Rake tasks for run Rails engines migrations</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/ttVKizOgSD4/rake-tasks-for-run-rails-engines-migrations</link>
      <description>&lt;p&gt;
  I created a patch for run engine's migrations, it adds two Rake tasks:
  &lt;ul&gt;
    &lt;li&gt;db:migrate:engines&lt;/li&gt;
    &lt;li&gt;db:migrate:engines:down&lt;/li&gt;
  &lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
The first one allows to run all the migrations stored in the db/migrate directory of each plugin.&lt;br /&gt;
It runs migrations in the same order &lt;code&gt;Rails::Initializer&lt;/code&gt; register the plugins, this means if you force an order by &lt;code&gt;environment.rb&lt;/code&gt;, it will be reflected on migrations order.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Example:&lt;br /&gt;
You have four plugins in your app: &lt;code&gt;apple&lt;/code&gt;, &lt;code&gt;bar&lt;/code&gt;, &lt;code&gt;foo&lt;/code&gt;, &lt;code&gt;pear&lt;/code&gt;.&lt;br /&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; environment.rb&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; &lt;span class="Support"&gt;Rails&lt;/span&gt;::&lt;span class="Entity"&gt;Initializer&lt;/span&gt;.&lt;span class="Entity"&gt;run&lt;/span&gt; &lt;span class="Keyword"&gt;do &lt;/span&gt;|&lt;span class="Variable"&gt;config&lt;/span&gt;|
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt;   config.&lt;span class="Entity"&gt;plugins&lt;/span&gt; &lt;span class="Keyword"&gt;=&lt;/span&gt; [ &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;foo&lt;/span&gt;, &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;bar&lt;/span&gt;, &lt;span class="Constant"&gt;&lt;span class="Constant"&gt;:&lt;/span&gt;all&lt;/span&gt; ]
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; &lt;span class="Keyword"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;The task will run migrations in the following order: &lt;code&gt;foo&lt;/code&gt;, &lt;code&gt;bar&lt;/code&gt;, &lt;code&gt;apple&lt;/code&gt;, &lt;code&gt;pear&lt;/code&gt;.
&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
It also add table structure declaration to your &lt;code&gt;db/schema.rb&lt;/code&gt; (only if &lt;code&gt;ActiveRecord::Base.schema_format == :ruby&lt;/code&gt;) and leave untouched your original version value.&lt;br /&gt;
This make totally independent app migrations from engine migrations.&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Example:&lt;br /&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; db/migrate/20090224121645_create_birds.rb
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; vendor/plugins/foo/db/migrate/20080224121645_create_foos.rb
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; vendor/plugins/foo/db/migrate/20080224121646_create_bars.rb
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; $ rake db:migrate              # =&amp;gt; create birds         (current tables: birds)
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt; $ rake db:migrate:engines      # =&amp;gt; create foos and bars (current tables: birds, foos and bars)
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; $ rake db:migrate VERSION=0    # =&amp;gt; delete birds         (current tables: foos and bars)
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt; $ rake db:migrate              # =&amp;gt; create birds, again  (current tables: birds, foos and bars)
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt; $ rake db:migrate:engines:down # =&amp;gt; delete foos and bars (current tables: birds)
&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
You can also specify if run migrations only from a specific engine:&lt;br /&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; $ rake db:migrate:engines ENGINE=foo      # =&amp;gt; run migrations from 'foo' engine only
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; $ rake db:migrate:engines:down ENGINE=foo # =&amp;gt; run down migrations from 'foo' engine only
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; $ rake db:migrate:engines ENGINE=bar      # =&amp;gt; raise an exception if 'bar' engine is missing
&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
This patch also supports mixed migrations versioning, this means you can use both timestamped and numeric migrations in your plugins.&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Example:&lt;br /&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; db/migrate/20090224121645_create_birds.rb
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; vendor/plugins/bar/db/migrate/001_create_bars.rb
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; vendor/plugins/foo/db/migrate/20080224121645_create_foos.rb
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; $ rake db:migrate                         # =&amp;gt; create birds            (current tables: birds)
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt; $ rake db:migrate:engines                 # =&amp;gt; create from bar and foo (current tables: birds, bars and foos)
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; $ rake db:migrate:engines:down ENGINE=bar # =&amp;gt; delete from bar         (current tables: birds and foos)
&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
You can also run migrations from engines first, then yours.&lt;br /&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; $ rake db:migrate:engines # =&amp;gt; create from bar and foo (current tables: bars and foos)
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; $ rake db:migrate         # =&amp;gt; create birds            (current tables: birds, bars and foos)
&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;As you can see running migrations is an &lt;strong&gt;"engine atomic"&lt;/strong&gt; operation, and it makes sense, because engines are pluggedin applications and you want to run &lt;strong&gt;all the migrations&lt;/strong&gt; from a single engine, in order to make it full working.&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
Now imagine to have the 0.0.1 version of a plugin called 'foo' with the following migrations:&lt;br /&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; vendor/plugins/foo/db/migrate/20080224121645_create_foos.rb
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; vendor/plugins/foo/db/migrate/20080224121646_create_bars.rb
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Your run your migrations, alongside with yours, so you have &lt;code&gt;birds&lt;/code&gt;, &lt;code&gt;foos&lt;/code&gt; and &lt;code&gt;bars&lt;/code&gt; tables.&lt;br /&gt;
When the authors will release the 0.0.2, adding a third migration, if you execute &lt;code&gt;db:migrate:engines&lt;/code&gt;, &lt;strong&gt;only the last migration&lt;/strong&gt; will be ran, instead of the full suite.&lt;br /&gt;
And of course this is a bless if you want to keep up-to-date your plugins.
&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;I created a &lt;a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2058-rake-tasks-for-run-engine-migrations" title="Rake tasks for run engine migrations"&gt;Lighthouse ticket&lt;/a&gt; for this patch, so if you appreciate it, please vote with a &lt;strong&gt;+1&lt;/strong&gt;.&lt;/p&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;

&lt;p&gt;&lt;strong&gt;UPDATE 2009-02-28:&lt;/strong&gt; I completely rewrote the patch, changing its behavior, fixing stuff and adding a &lt;code&gt;version&lt;/code&gt; column to &lt;code&gt;schema_migrations&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;
Two important changes are about &lt;code&gt;db:migrate&lt;/code&gt; and &lt;code&gt;test&lt;/code&gt; tasks: they both automatically check/run migrations from plugins. This means test suite will be halted if there are pending migrations from plugins.&lt;br /&gt;&lt;br /&gt;

I also added a lot of new rake tasks (also for migrating from old Rails versions), and a script for rename a plugin.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;

For a full review, please visit the &lt;a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2058-rake-tasks-for-run-engine-migrations" title="Rake tasks for run engine migrations"&gt;Lighthouse ticket&lt;/a&gt;.
&lt;/p&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;

&lt;p&gt;&lt;strong&gt;UPDATE 2009-02-28 (2):&lt;/strong&gt; I extracted the patch into a plugin: &lt;a href="http://github.com/jodosha/plugin_migrations/tree/master" title="plugin_migrations"&gt;plugin_migrations&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YsOPF68vIVohEnD7M2RYyFWvCPc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YsOPF68vIVohEnD7M2RYyFWvCPc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YsOPF68vIVohEnD7M2RYyFWvCPc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YsOPF68vIVohEnD7M2RYyFWvCPc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=ttVKizOgSD4:n-MNMMmdBkw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=ttVKizOgSD4:n-MNMMmdBkw:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=ttVKizOgSD4:n-MNMMmdBkw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=ttVKizOgSD4:n-MNMMmdBkw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=ttVKizOgSD4:n-MNMMmdBkw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=ttVKizOgSD4:n-MNMMmdBkw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Wed, 25 Mar 2009 18:54:17 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/02/24/rake-tasks-for-run-rails-engines-migrations</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/02/24/rake-tasks-for-run-rails-engines-migrations</feedburner:origLink></item>
    <item>
      <title>How to use Sprockets with Rails</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/Id5sFiW6ieU/how-to-use-sprockets-with-rails</link>
      <description>&lt;p&gt;&lt;a href="http://conio.net/" title="Sam Stephenson"&gt;Sam Stephenson&lt;/a&gt; has recently released a Javascript preprocessor called &lt;a href="http://getsprockets.org" title="Sprockets"&gt;Sprockets&lt;/a&gt;.&lt;br /&gt;
It's distributed as Ruby gem, and it helps to declare scripts dependencies through special comments, and safely build them one script. It's very useful for maintain your Javascript projects, extract reusable code and share across applications.&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;

&lt;p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; $ (sudo) gem install sprockets
&lt;/pre&gt;&lt;p&gt;It will also install &lt;code&gt;sprocketize&lt;/code&gt; executable.
&lt;/p&gt;&lt;/p&gt;

&lt;h2&gt;How it works?&lt;/h2&gt;

&lt;p&gt;&lt;p&gt;
  To declare a dependency use &lt;code&gt;require&lt;/code&gt; directive:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;prototype&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;quot;cookies&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;
  When you use angular brackets the script will be searched in all the Sprockets load path, if you use quotes instead, you are forcing to load the file from the current directory. Usually you should use the first way to require frameworks or libraries and the second one for your scripts.&lt;br /&gt;
&lt;/p&gt;&lt;/p&gt;

&lt;h2&gt;How it works with Rails?&lt;/h2&gt;

&lt;p&gt;&lt;p&gt;
  Sam has wrote a &lt;a href="http://github.com/sstephenson/sprockets-rails" title="sprockets-rails"&gt;plugin&lt;/a&gt; to use Sprockets with Rails, let's install it:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; $ ./script/install plugin git://github.com/sstephenson/sprockets-rails.git
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;
  It automatically creates two folders: &lt;code&gt;app/javascripts&lt;/code&gt; and &lt;code&gt;vendor/sprockets&lt;/code&gt;.
&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;Move all the files from &lt;code&gt;public/javascripts&lt;/code&gt; to the first folder.&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
  Now let's sprocketize our files:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;/*&lt;/span&gt; controls.js &lt;span class="Comment"&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;prototype&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;effects&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;/*&lt;/span&gt; dragdrop.js &lt;span class="Comment"&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;prototype&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;effects&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;/*&lt;/span&gt; effects.js &lt;span class="Comment"&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;prototype&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  11 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  12 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;/*&lt;/span&gt; lowpro.js &lt;span class="Comment"&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  13 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;prototype&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  14 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  15 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;/*&lt;/span&gt; prototype.js &lt;span class="Comment"&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  16 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt; nothing to do&lt;/span&gt;
&lt;span class="line-numbers"&gt;  17 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  18 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;/*&lt;/span&gt; application.js &lt;span class="Comment"&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  19 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;prototype&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  20 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;lowpro&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  21 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;effects&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  22 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;dragdrop&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  23 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;controls&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  24 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  25 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;/*&lt;/span&gt; comments.js &lt;span class="Comment"&gt;*/&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  26 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;lt;prototype&amp;gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  27 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= require &amp;quot;application&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;
  Of course &lt;code&gt;application.js&lt;/code&gt; and &lt;code&gt;comments.js&lt;/code&gt; configurations depends on which libraries you need for your scripts.
&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
  One last step, we have to configure our routes with:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt; config/routes.rb&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; &lt;span class="Support"&gt;SprocketsApplication&lt;/span&gt;.&lt;span class="Entity"&gt;routes&lt;/span&gt;(map)
&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
  Now forget about &lt;code&gt;javascript&lt;em&gt;include&lt;/em&gt;tag&lt;/code&gt; helper and place &lt;strong&gt;one time&lt;/strong&gt; at the bottom of your template:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="EmbeddedSource"&gt;&lt;span class="EmbeddedSource"&gt;&amp;lt;%=&lt;/span&gt; sprockets_include_tag &lt;span class="EmbeddedSource"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;
  sprockets-rails will provide all the scripts needed by your application.
&lt;/p&gt;&lt;/p&gt;

&lt;h2&gt;Advanced sprocketing&lt;/h2&gt;

&lt;p&gt;&lt;p&gt;
  Sprockets help you to bundle all kind of assets (HTML, CSS, images) your Javascript project needs. Imagine to have a plugin with &lt;code&gt;assets&lt;/code&gt; and &lt;code&gt;javascripts&lt;/code&gt; folders, in your script you can declare:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; &lt;span class="Comment"&gt;&lt;span class="Comment"&gt;//&lt;/span&gt;= provide &amp;quot;../assets&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;
  Just running &lt;code&gt;sprockets:install_assets&lt;/code&gt; rake task, sprockets-rails will copy all the assets and scripts to the public folder.
&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;If you want to use the edge of favorite javascript frameworks like &lt;strong&gt;jQuery&lt;/strong&gt; Sprockets will bundle for you. For example if you want to add Prototype's edge, just copy &lt;code&gt;src&lt;/code&gt; folder under vendored folder of Sprockets:&lt;/p&gt;&lt;pre class="twilight"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; vendor/sprockets/prototype/src
&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;

&lt;h2&gt;Deployment&lt;/h2&gt;

&lt;p&gt;Add &lt;code&gt;sprockets:install_script&lt;/code&gt; as &lt;a href="http://www.capify.org/" title="Capistrano"&gt;Capistrano&lt;/a&gt; post-deploy hook to generate the all-in-bundle script.&lt;/p&gt;

&lt;h2&gt;One more thing&lt;/h2&gt;

&lt;p&gt;If you use &lt;a href="http://lucaguidi.com/pages/assets_packager" title="assets_packager"&gt;assets_packager&lt;/a&gt;, I just &lt;a href="http://github.com/jodosha/assets_packager/commit/1b90e1fdbd070819e8ece42875f18f3238851081"&gt;committed&lt;/a&gt; a sprocketized version of rake tasks.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3vEtu1iScLdwEIQ1gafIU-S_Fpk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3vEtu1iScLdwEIQ1gafIU-S_Fpk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3vEtu1iScLdwEIQ1gafIU-S_Fpk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3vEtu1iScLdwEIQ1gafIU-S_Fpk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=Id5sFiW6ieU:Nw_gCxAnjtY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=Id5sFiW6ieU:Nw_gCxAnjtY:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=Id5sFiW6ieU:Nw_gCxAnjtY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=Id5sFiW6ieU:Nw_gCxAnjtY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=Id5sFiW6ieU:Nw_gCxAnjtY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=Id5sFiW6ieU:Nw_gCxAnjtY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Wed, 25 Mar 2009 18:54:17 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/02/23/how-to-use-sprockets-with-rails</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/02/23/how-to-use-sprockets-with-rails</feedburner:origLink></item>
    <item>
      <title>Getting started with CachedModels</title>
      <link>http://feedproxy.google.com/~r/LucaGuidi/~3/5Hkc_UwprfM/getting-started-with-cachedmodels</link>
      <description>&lt;p&gt;&lt;object width="600" height="376"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3243531&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=1" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=3243531&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=00ADEF&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="376"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;a href="http://vimeo.com/3243531"&gt;Getting started with CachedModels&lt;/a&gt; from &lt;a href="http://vimeo.com/user1310784"&gt;Luca Guidi&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MQMK69MdyZ9g8Mqc3T-MJphwKjM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MQMK69MdyZ9g8Mqc3T-MJphwKjM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MQMK69MdyZ9g8Mqc3T-MJphwKjM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MQMK69MdyZ9g8Mqc3T-MJphwKjM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=5Hkc_UwprfM:QOxc2d_G5yU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=5Hkc_UwprfM:QOxc2d_G5yU:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=5Hkc_UwprfM:QOxc2d_G5yU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=5Hkc_UwprfM:QOxc2d_G5yU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LucaGuidi?a=5Hkc_UwprfM:QOxc2d_G5yU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LucaGuidi?i=5Hkc_UwprfM:QOxc2d_G5yU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Wed, 25 Mar 2009 18:54:17 GMT</pubDate>
      <guid isPermaLink="false">http://lucaguidi.com/2009/02/17/getting-started-with-cachedmodels</guid>
      <author>guidi.luca@gmail.com (Luca Guidi)</author>
    <feedburner:origLink>http://lucaguidi.com/2009/02/17/getting-started-with-cachedmodels</feedburner:origLink></item>
  </channel>
</rss>
