<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>defsdoor - Home</title>
  <id>tag:blog.defsdoor.org,2008:mephisto/</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://blog.defsdoor.org/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.defsdoor.org/" rel="alternate" type="text/html"/>
  <updated>2008-04-30T09:41:54Z</updated>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2008-04-30:2239</id>
    <published>2008-04-30T09:41:00Z</published>
    <updated>2008-04-30T09:41:54Z</updated>
    <link href="http://blog.defsdoor.org/2008/4/30/dilbert-com" rel="alternate" type="text/html"/>
    <title>Dilbert.com</title>
<content type="html">
            &lt;p&gt;We are sorry for the trouble you have been having with the new launch. We hope all the work we will be doing in the coming weeks will make it easier for you to enjoy Dilbert in all his incarnations. Just so you know, we are thinning out the flash, streamlining the mashups, making the site easier to navigate as well as allowing those on non-supported operating systems to view the animations.&lt;/p&gt;

&lt;p&gt;For those of you who are unhappy with the new site, this note from Scott Adams should answer some of your questions:&lt;/p&gt;

&lt;p&gt;&#8230;&#8230;..&lt;/p&gt;

&lt;p&gt;Recently we redesigned the Dilbert.com web site and added a ton of features, such as animation, deeper archives, mash ups, and more. The reaction from readers has been fascinating.&lt;/p&gt;

&lt;p&gt;www.dilbert.com&lt;/p&gt;

&lt;p&gt;Let me get this out of the way: I realize the Beta version of the web site has lots of issues. It’s overloaded with Flash, slower than it needs to be, and the navigation is confusing. We’re fixing most of that over the next few weeks. I apologize for the inconvenience.&lt;/p&gt;

&lt;p&gt;The fascinating thing about the responses is that it revealed three distinct types of Dilbert readers:&lt;/p&gt;

&lt;p&gt;The first group is the ultra-techies who have an almost romantic relationship with technology. For them, the new site felt like getting dumped by a lover. Their high-end technology (generally Linux) and security settings made much of the site inconvenient. Moreover, the use of Flash offended them on some deep emotional level.&lt;/p&gt;

&lt;p&gt;The second group objected to the new level of color and complexity, and the associated slowness. They like their Dilbert comics simple, fast, and in two colors. Anything more is like putting pants on a cat.&lt;/p&gt;

&lt;p&gt;The third group uses technology as nothing more than a tool, and subscribes to the philosophy that more free stuff is better than less free stuff. That group has embraced the new features on the site and spiked the traffic stats.&lt;/p&gt;

&lt;p&gt;For you first two groups, if you promise to keep it to yourselves, we created a stripped-down Dilbert page with just the comic, some text navigation, and the archive: www.dilbert.com/fast. This alternate site is a minor secret, mentioned only here and in the text footnote to the regular site as &#8220;Linux/Unix.&#8221;&lt;/p&gt;

&lt;p&gt;The main site will be getting a Flash diet that will make it speedier soon, so check back in a few weeks. That’s where all the fun will be.&lt;/p&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;

&lt;p&gt;……&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Dilbert.com Customer Service&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2008-01-21:89</id>
    <published>2008-01-21T11:06:00Z</published>
    <updated>2008-01-21T11:07:36Z</updated>
    <category term="Linux"/>
    <category term="Rails"/>
    <link href="http://blog.defsdoor.org/2008/1/21/installing-rubyonrails-from-source-on-debian" rel="alternate" type="text/html"/>
    <title>Installing RubyonRails from source on Debian</title>
<content type="html">
            &lt;p&gt;I'm installing a dedicated rails server.  This is the documentation on getting things working on Debian stable.&lt;/p&gt;

&lt;p&gt;Firstly, I chose to install ruby and rubygems from source because the packages in Debian Stable are a little older than I would like.&lt;/p&gt;

&lt;p&gt;First thing to do is get a development environment installed on Debian.  The quickest/simplest way is to install the build-essential pseudo package.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;aptitude install build-essential
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then we need zlib libraries for ruby &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;aptitude install zlib1g-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Download the &lt;a href=&quot;http://www.ruby-lang.org/en/downloads/&quot;&gt;ruby source code&lt;/a&gt;
and extract it &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;tar zxvf ruby-1.8.6-p111.tar.gz

cd ruby-1.8.6-p111
./configure
make
sudo make install
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Download &lt;a href=&quot;http://rubyforge.org/frs/?group_id=126&quot;&gt;ruby gems&lt;/a&gt; and extract it&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;tar zxvf rubygems-1.0.1.tgz
cd rubygems-1.0.1
ruby ./setup.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Install rails&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem install rails
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Install msyql&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;aptitude install mysql-server
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and client libraries&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;aptitude install libmysqlclient15-dev

gem install mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and that's it done.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-09-05:85</id>
    <published>2007-09-05T13:01:00Z</published>
    <updated>2007-09-05T13:06:24Z</updated>
    <category term="Linux"/>
    <link href="http://blog.defsdoor.org/2007/9/5/offsite-backups" rel="alternate" type="text/html"/>
    <title>Offsite Backups</title>
<content type="html">
            &lt;p&gt;I have an external fireware enclosure that is now full of drives - 3.4TB in total.  I use these drives for offsite backups.  I connect to remote servers and rsync all the important stuff onto the drives on a 10 day cycle.&lt;/p&gt;

&lt;p&gt;Thanks to some clever use of hard links and rsync I don&#8217;t need 10 times the disk space to do this though.  It works like this - &lt;/p&gt;

&lt;p&gt;Day 1
rsync remote directories to backup.1 on back drive&lt;/p&gt;

&lt;p&gt;Day 2
Hard link backup.1 files to backup.2
rsync remote directories to backup.1&lt;/p&gt;

&lt;p&gt;Day 3 
Rename backup.2 to backup.3
Hard link backup.1 files to backup.2
rsync remote directories to backup.1&lt;/p&gt;

&lt;p&gt;And so on.  The number of backups in the cycle is configurable.  The magic is in how rsync rebuilds a file that needs updating - it creates a new file and assembles it from the local file and the remote file and then removes the local file and replaces it with the new one - therefore breaking the hard link.&lt;/p&gt;

&lt;p&gt;So if a file hasn&#8217;t changed it occupies the same space on the disk for each copy.&lt;/p&gt;

&lt;p&gt;The script - below - takes 2 options - -b specifies the number of backups in a cycle and -s tells the script that you want a single update - this will simply refresh the newest backup - without doing any rolling back.&lt;/p&gt;

&lt;p&gt;You must also supply a parameter to the script to tell it which backup you are running - this is used to mount the appropriate drive - achieved using drive labels.&lt;/p&gt;

&lt;p&gt;Once the drive is mounted a file called backup.list is read - this file specifies the source server, the source path and the destination folder in the backup.  i.e. &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
webserver /var/www/ webserver/documentroot
dnsserver /etc/bind/ dnsserver/bind 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The script&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;32&lt;tt&gt;
&lt;/tt&gt;33&lt;tt&gt;
&lt;/tt&gt;34&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;36&lt;tt&gt;
&lt;/tt&gt;37&lt;tt&gt;
&lt;/tt&gt;38&lt;tt&gt;
&lt;/tt&gt;39&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;40&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;41&lt;tt&gt;
&lt;/tt&gt;42&lt;tt&gt;
&lt;/tt&gt;43&lt;tt&gt;
&lt;/tt&gt;44&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;45&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;46&lt;tt&gt;
&lt;/tt&gt;47&lt;tt&gt;
&lt;/tt&gt;48&lt;tt&gt;
&lt;/tt&gt;49&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;50&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;51&lt;tt&gt;
&lt;/tt&gt;52&lt;tt&gt;
&lt;/tt&gt;53&lt;tt&gt;
&lt;/tt&gt;54&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;55&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;56&lt;tt&gt;
&lt;/tt&gt;57&lt;tt&gt;
&lt;/tt&gt;58&lt;tt&gt;
&lt;/tt&gt;59&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;60&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;61&lt;tt&gt;
&lt;/tt&gt;62&lt;tt&gt;
&lt;/tt&gt;63&lt;tt&gt;
&lt;/tt&gt;64&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;65&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;66&lt;tt&gt;
&lt;/tt&gt;67&lt;tt&gt;
&lt;/tt&gt;68&lt;tt&gt;
&lt;/tt&gt;69&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;70&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;71&lt;tt&gt;
&lt;/tt&gt;72&lt;tt&gt;
&lt;/tt&gt;73&lt;tt&gt;
&lt;/tt&gt;74&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;75&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;76&lt;tt&gt;
&lt;/tt&gt;77&lt;tt&gt;
&lt;/tt&gt;78&lt;tt&gt;
&lt;/tt&gt;79&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;80&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;81&lt;tt&gt;
&lt;/tt&gt;82&lt;tt&gt;
&lt;/tt&gt;83&lt;tt&gt;
&lt;/tt&gt;84&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;85&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;86&lt;tt&gt;
&lt;/tt&gt;87&lt;tt&gt;
&lt;/tt&gt;88&lt;tt&gt;
&lt;/tt&gt;89&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;90&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;91&lt;tt&gt;
&lt;/tt&gt;92&lt;tt&gt;
&lt;/tt&gt;93&lt;tt&gt;
&lt;/tt&gt;94&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;95&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;96&lt;tt&gt;
&lt;/tt&gt;97&lt;tt&gt;
&lt;/tt&gt;98&lt;tt&gt;
&lt;/tt&gt;99&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;100&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;101&lt;tt&gt;
&lt;/tt&gt;102&lt;tt&gt;
&lt;/tt&gt;103&lt;tt&gt;
&lt;/tt&gt;104&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;105&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;106&lt;tt&gt;
&lt;/tt&gt;107&lt;tt&gt;
&lt;/tt&gt;108&lt;tt&gt;
&lt;/tt&gt;109&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;110&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;111&lt;tt&gt;
&lt;/tt&gt;112&lt;tt&gt;
&lt;/tt&gt;113&lt;tt&gt;
&lt;/tt&gt;114&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;115&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;116&lt;tt&gt;
&lt;/tt&gt;117&lt;tt&gt;
&lt;/tt&gt;118&lt;tt&gt;
&lt;/tt&gt;119&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;120&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;121&lt;tt&gt;
&lt;/tt&gt;122&lt;tt&gt;
&lt;/tt&gt;123&lt;tt&gt;
&lt;/tt&gt;124&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/ksh&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# Script to mount usb drive, rsync various bits, umount&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;function log {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;co&quot;&gt;D&lt;/span&gt;=&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt;(date &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;+%Y/%m/%d %H:%M:%S&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;  print -- &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$D $*&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;integer &lt;span class=&quot;co&quot;&gt;BACKUPS&lt;/span&gt;=&lt;span class=&quot;i&quot;&gt;5&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;co&quot;&gt;TODO&lt;/span&gt;=&lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;co&quot;&gt;OPTS&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$*&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;while&lt;/span&gt; getopts b&lt;span class=&quot;sy&quot;&gt;:s&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;ARG&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;gv&quot;&gt;$ARG&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;in&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    b) &lt;span class=&quot;co&quot;&gt;BACKUPS&lt;/span&gt;=&lt;span class=&quot;gv&quot;&gt;$OPTARG&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      ;;&lt;tt&gt;
&lt;/tt&gt;    s) &lt;span class=&quot;co&quot;&gt;TODO&lt;/span&gt;=&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      ;;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;i&quot;&gt;?)&lt;/span&gt; print -u2 &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Invalid argument&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      exit &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      ;;&lt;tt&gt;
&lt;/tt&gt;  esac&lt;tt&gt;
&lt;/tt&gt;done&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;((&lt;span class=&quot;co&quot;&gt;OPTIND&lt;/span&gt;=&lt;span class=&quot;co&quot;&gt;OPTIND&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;-1&lt;/span&gt;))&lt;tt&gt;
&lt;/tt&gt;shift &lt;span class=&quot;gv&quot;&gt;$OPTIND&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; [[ &lt;span class=&quot;er&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;# != 1 ]]&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  print -u2 &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;No host specified&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  exit &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;fi&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;co&quot;&gt;HOST&lt;/span&gt;=&lt;span class=&quot;gv&quot;&gt;$1&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Backup Starting $OPTS&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;co&quot;&gt;MOUNTPOINT&lt;/span&gt;=&lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;backups&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;backup.&lt;span class=&quot;gv&quot;&gt;$HOST&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;mkdir &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt; &amp;gt; &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;dev&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mod&quot;&gt;nu&lt;/span&gt;&lt;/span&gt;ll &lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;&amp;gt;&amp;amp;&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# Find the device for the called HOST&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; mount -&lt;span class=&quot;co&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;gv&quot;&gt;$HOST&lt;/span&gt; &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Disk for $HOST mounted on $MOUNTPOINT&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Cannot find host backup volume $HOST&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  exit &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;fi&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;df -v &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; [[ &lt;span class=&quot;gv&quot;&gt;$TODO&lt;/span&gt; != &lt;span class=&quot;i&quot;&gt;1&lt;/span&gt; ]]&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#roll back and recreate backup&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  integer &lt;span class=&quot;co&quot;&gt;N&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  integer &lt;span class=&quot;co&quot;&gt;M&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  ((&lt;span class=&quot;co&quot;&gt;N&lt;/span&gt;=&lt;span class=&quot;co&quot;&gt;BACKUPS&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;-1&lt;/span&gt;))&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;while&lt;/span&gt; ((&lt;span class=&quot;co&quot;&gt;N&lt;/span&gt;&amp;gt;=&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;))&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    ((&lt;span class=&quot;co&quot;&gt;M&lt;/span&gt;=&lt;span class=&quot;co&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;+1&lt;/span&gt;))&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; [[ ! -d &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;gv&quot;&gt;$N&lt;/span&gt; ]]&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Creating sequential backup directory backup.$N&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      mkdir &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;gv&quot;&gt;$N&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    fi&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; [[ -d &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;gv&quot;&gt;$M&lt;/span&gt; ]]&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Removing backup directory backup.$M&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      rm -rf &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;gv&quot;&gt;$M&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    fi&lt;tt&gt;
&lt;/tt&gt;    log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Moving backup.$N to backup.$M&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    mv &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;gv&quot;&gt;$N&lt;/span&gt; &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;gv&quot;&gt;$M&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;co&quot;&gt;RES&lt;/span&gt;=&lt;span class=&quot;gv&quot;&gt;$?&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; [[ &lt;span class=&quot;gv&quot;&gt;$RES&lt;/span&gt; != &lt;span class=&quot;i&quot;&gt;0&lt;/span&gt; ]]&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;co&quot;&gt;STATUS&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Failed&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;co&quot;&gt;STATUS&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Complete&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    fi&lt;tt&gt;
&lt;/tt&gt;    log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Sync $STATUS&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    ((&lt;span class=&quot;co&quot;&gt;N&lt;/span&gt;=&lt;span class=&quot;co&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;-1&lt;/span&gt;))&lt;tt&gt;
&lt;/tt&gt;  done&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Creating sequential backup directory backup.2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  mkdir &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Duplicating latest backup into $MOUNTPOINT/backup.2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  cp -al &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;/* &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;i&quot;&gt;2&lt;/span&gt;/.&lt;tt&gt;
&lt;/tt&gt;else&lt;tt&gt;
&lt;/tt&gt;  log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Refreshing latest backup only&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;fi&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;while&lt;/span&gt; read &lt;span class=&quot;co&quot;&gt;SERVER&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;SOURCE&lt;/span&gt; &lt;span class=&quot;co&quot;&gt;DESTINATION&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; [[ ! -d &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;gv&quot;&gt;$DESTINATION&lt;/span&gt; ]]&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; ! mkdir -p &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;gv&quot;&gt;$DESTINATION&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      log -u2 &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Failed to create $MOUNTPOINT/backup.1/$DESTINATION&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      continue&lt;tt&gt;
&lt;/tt&gt;    fi&lt;tt&gt;
&lt;/tt&gt;  fi&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Syncing $SERVER:$SOURCE to backup.1/$DESTINATION&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  rsync -az --delete --exclude=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;ch&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;gv&quot;&gt;$SERVER&lt;/span&gt;&lt;span class=&quot;sy&quot;&gt;:$SOURCE&lt;/span&gt; &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backup.&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;gv&quot;&gt;$DESTINATION&lt;/span&gt;/.&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;co&quot;&gt;RES&lt;/span&gt;=&lt;span class=&quot;gv&quot;&gt;$?&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; [[ &lt;span class=&quot;gv&quot;&gt;$RES&lt;/span&gt; != &lt;span class=&quot;i&quot;&gt;0&lt;/span&gt; ]]&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;then&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;co&quot;&gt;STATUS&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Failed ($RES)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;else&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;co&quot;&gt;STATUS&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Complete&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  fi&lt;tt&gt;
&lt;/tt&gt;  log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Sync $STATUS&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;done &amp;lt; &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;/backuplist&lt;tt&gt;
&lt;/tt&gt;df -v &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;umount &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;rmdir &lt;span class=&quot;gv&quot;&gt;$MOUNTPOINT&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;log &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Backup for host $HOST complete&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-09-02:84</id>
    <published>2007-09-02T11:33:00Z</published>
    <updated>2007-09-02T11:37:00Z</updated>
    <link href="http://blog.defsdoor.org/2007/9/2/asent-minded" rel="alternate" type="text/html"/>
    <title>Absent (minded)</title>
<content type="html">
            &lt;p&gt;I've been away (got married, had honeymoon etc..).  Not had much time to spare let alone any for programming until now and now I can't remember anything :)&lt;/p&gt;

&lt;p&gt;I've decided that from now on I will use my blog purely for useful information to remind me of things.  Mainly for my benefit but as it's online it might be useful for others.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-06-21:73</id>
    <published>2007-06-21T09:30:00Z</published>
    <updated>2007-06-21T10:53:00Z</updated>
    <category term="Rails"/>
    <link href="http://blog.defsdoor.org/2007/6/21/restful-rails" rel="alternate" type="text/html"/>
    <title>Restful Rails</title>
<content type="html">
            &lt;p&gt;I recently took the decision to move to using restful rails.  In simple terms it removes the action from the URL and uses HTTP's built-in functionality to determine the actions being requested.&lt;/p&gt;

&lt;p&gt;So, instead of requesting /users/show/1 you simply request /users/1 with a (normal) HTTP GET method.&lt;/p&gt;

&lt;p&gt;No shocks there - pretty sensible and obvious.&lt;/p&gt;

&lt;p&gt;To update a user you perform a HTTP PUT method on the same URL, and to delete you perfrom HTTP DELETE.&lt;/p&gt;

&lt;p&gt;There are some niggles - such as coping with edits and news but rails identifies these by appending the action after the URL with a semi-colon delimiter - /users/1;edit or /users;new.&lt;/p&gt;

&lt;p&gt;To turn on restful routes you simply add 
&lt;code&gt;&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;map.resources &lt;span class=&quot;sy&quot;&gt;:users&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;&lt;/code&gt;
to your routes.rb file.&lt;/p&gt;

&lt;p&gt;This adds a whole bunch of new helpers too that you use to construct the URLs you need to use, such as &lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;edit_user_path(&lt;span class=&quot;iv&quot;&gt;@user&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;new_user_path(&lt;span class=&quot;iv&quot;&gt;@user&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Theres a catch though when using AJAX calls - you need to also add :method =&gt; :GET (or POST etc..)  - I see this as a bit of a hack and hopefully it will be more elegant in future.
See the &lt;a href=&quot;http://api.rubyonrails.org/classes/ActionController/Resources.html&quot;&gt;API&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;To get up to speed on using restul routes &lt;a href=&quot;http://www.scribemedia.org/2006/07/09/dhh/&quot;&gt;DHH's rails conf keynote of 2006&lt;/a&gt; is good viewing - although some of the code examples given are out of date since it was added to core rails.&lt;/p&gt;

&lt;p&gt;This &lt;a href=&quot;http://www.b-simple.de/documents/download/6&quot;&gt;PDF&lt;/a&gt; is also a worthwhile read.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-06-06:63</id>
    <published>2007-06-06T09:58:00Z</published>
    <updated>2007-06-06T09:58:36Z</updated>
    <category term="Rails"/>
    <link href="http://blog.defsdoor.org/2007/6/6/i-ve-moved-to-the-dark-side" rel="alternate" type="text/html"/>
    <title>I've moved to the dark side</title>
<content type="html">
            &lt;p&gt;I&#8217;m an avid Linux user - both on the server side of things and the desktop. &lt;/p&gt;

&lt;p&gt;But this week I got a Macbook Pro.  Primarily for Rails development but also some photo work and as  a general-use laptop.&lt;/p&gt;

&lt;p&gt;I love it.  Apple isn&#8217;t quite the dark side but it was always a little grey to me,  but everything on a Mac looks so fresh and clean!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-04-10:10</id>
    <published>2007-04-10T20:49:00Z</published>
    <updated>2007-04-10T20:49:30Z</updated>
    <category term="Rails"/>
    <link href="http://blog.defsdoor.org/2007/4/10/using-subversion" rel="alternate" type="text/html"/>
    <title>Using Subversion</title>
<content type="html">
            &lt;p&gt;I've recently moved my main application to a new off-site web server.  I used the move as an excuse to also use subversion and capistrano and could not have got started without the great primer on Rails and subversion &lt;a href=&quot;http://blog.teksol.info/articles/2006/03/09/subversion-primer-for-rails-projects&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After some slight hicoughs I seem to have it all working and now wish I had used it from the beginning.  Being able to upgrade my live server by simply typing &lt;em&gt;cap deploy&lt;/em&gt; is pretty awesome :)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-03-12:9</id>
    <published>2007-03-12T10:56:00Z</published>
    <updated>2007-03-12T15:50:07Z</updated>
    <category term="Rails"/>
    <link href="http://blog.defsdoor.org/2007/3/12/rails-helpers-and-a-little-bit-of-javascript" rel="alternate" type="text/html"/>
    <title>Rails Helpers (and a little bit of javascript)</title>
<content type="html">
            &lt;p&gt;On a website I have the following simple Rails/Scriptaculous list - &lt;/p&gt;

&lt;ul&gt;
 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;A List Item&lt;/a&gt;
  &lt;div&gt;The text in this list item refers to the list item below, and when you click on &lt;a href=&quot;#&quot;&gt; this link&lt;/a&gt; the item below should open also&lt;/div&gt;
&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Another List Item&lt;/a&gt;
   &lt;div&gt;This is the text explaining the second item in this list.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click on the first item and then on the link referring to the next item.&lt;/p&gt;

&lt;p&gt;The first problem I had with this was that the standard scriptaculous routines don't support a blind-if-not-visible-already option - so when you clicked on the referring link, if the section it referred to was already visible it would hide and be displayed.&lt;/p&gt;

&lt;p&gt;I needed to check the display property of the DIV and only do the blind/appear if the DOM was currently hidden.
I chose to do this using a combination of some javascript and a helper.&lt;/p&gt;

&lt;h2&gt;Javascript&lt;/h2&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; slideshow(dom, options) {&lt;tt&gt;
&lt;/tt&gt;  Effect.toggle(dom,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;blind&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,options);&lt;tt&gt;
&lt;/tt&gt;  Effect.toggle(dom,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;appear&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,options);&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; highlight(dom, slideoptions, options) {&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; ($(dom).getStyle(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) == &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) {&lt;tt&gt;
&lt;/tt&gt;    Effect.toggle(dom,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;blind&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,slideoptions);&lt;tt&gt;
&lt;/tt&gt;    Effect.toggle(dom,&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;appear&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;,slideoptions);&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;  new Effect.Highlight(dom,options);&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;The javascript is pretty simple but it helps to reduce the code clutter in both the helper and the generated HTML.&lt;/p&gt;

&lt;h2&gt;Helper&lt;/h2&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;ApplicationHelper&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;slideshow&lt;/span&gt;(element_id = &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;, js_options = {})&lt;tt&gt;
&lt;/tt&gt;      element = element_id ? element_id.to_json : &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;] = &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;].is_a?(&lt;span class=&quot;co&quot;&gt;Hash&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; + js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;].map {|k, v| k == &lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt; ? &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;k&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;v&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; : &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;k&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:'&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;v&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; }.join(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) + &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;elsif&lt;/span&gt; js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;slideshow(&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;element&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;options_for_javascript(js_options)&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;highlight&lt;/span&gt;(element_id = &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;, sl_options={}, js_options={})&lt;tt&gt;
&lt;/tt&gt;      element = element_id ? element_id.to_json : &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;      js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;] = &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;].is_a?(&lt;span class=&quot;co&quot;&gt;Hash&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; + js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;].map {|k, v| k == &lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt; ? &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;k&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;v&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; : &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;k&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:'&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;v&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; }.join(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) + &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;elsif&lt;/span&gt; js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; js_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;      sl_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;] = &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; sl_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;].is_a?(&lt;span class=&quot;co&quot;&gt;Hash&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; + sl_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;].map {|k, v| k == &lt;span class=&quot;sy&quot;&gt;:limit&lt;/span&gt; ? &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;k&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;v&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; : &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;k&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:'&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;v&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; }.join(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) + &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;elsif&lt;/span&gt; sl_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;sl_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;if&lt;/span&gt; sl_options[&lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt;]&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;      &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;highlight(&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;element&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;options_for_javascript(sl_options)&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;#{&lt;/span&gt;options_for_javascript(js_options)&lt;span class=&quot;dl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;I stole most of the code in the helper from the existing scriptaculous helper.  As you can see it is just a simple wrapper to generate the javascript function call.  I could have simplified the use of my new helpers still by having the helper itself generate the links also but this would have also required supportting any additional attributes etc.. - as link_to_function already does this I decided using it was a no brainer.&lt;/p&gt;

&lt;h2&gt;View&lt;/h2&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt; &lt;span class=&quot;ta&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;lt;%=&lt;/span&gt; link_to_function &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;A List Item&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;  slideshow(&lt;span class=&quot;sy&quot;&gt;:list1&lt;/span&gt;, { &lt;span class=&quot;sy&quot;&gt;:duration&lt;/span&gt; =&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.5&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;parallel&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; }) &lt;span class=&quot;dl&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ta&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;list1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;style&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;display: none&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;   The text in this list item refers to the list item below,&lt;tt&gt;
&lt;/tt&gt;   and when you click on &lt;tt&gt;
&lt;/tt&gt;   &lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;lt;%=&lt;/span&gt; link_to_function &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this link&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;    highlight(&lt;span class=&quot;sy&quot;&gt;:list2&lt;/span&gt;,&lt;tt&gt;
&lt;/tt&gt;      { &lt;span class=&quot;sy&quot;&gt;:duration&lt;/span&gt; =&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.5&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;parallel&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; },&lt;tt&gt;
&lt;/tt&gt;      { &lt;span class=&quot;sy&quot;&gt;:duration&lt;/span&gt; =&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.5&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; } ) &lt;span class=&quot;dl&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;tt&gt;
&lt;/tt&gt;    the item below should open also&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ta&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt; &lt;span class=&quot;ta&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt; &lt;span class=&quot;ta&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;lt;%=&lt;/span&gt; link_to_function &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Another List Item&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;tt&gt;
&lt;/tt&gt;    slideshow( &lt;span class=&quot;sy&quot;&gt;:list1&lt;/span&gt;, { &lt;span class=&quot;sy&quot;&gt;:duration&lt;/span&gt; =&amp;gt; &lt;span class=&quot;fl&quot;&gt;0.5&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:queue&lt;/span&gt; =&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;parallel&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt; } ) &lt;span class=&quot;dl&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ta&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;list2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;an&quot;&gt;style&lt;/span&gt;=&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;display: none&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;ta&quot;&gt;&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    This is the text explaining the second item in this list.&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;ta&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt; &lt;span class=&quot;ta&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;ta&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-03-07:7</id>
    <published>2007-03-07T19:22:00Z</published>
    <updated>2007-03-07T19:29:02Z</updated>
    <category term="Rails"/>
    <link href="http://blog.defsdoor.org/2007/3/7/mental-masturbation" rel="alternate" type="text/html"/>
    <title>Mental Masturbation</title>
<content type="html">
            &lt;p&gt;Take a look at this code&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;: [forums(&lt;span class=&quot;sy&quot;&gt;:rails&lt;/span&gt;), users(&lt;span class=&quot;sy&quot;&gt;:tom&lt;/span&gt;), topics(&lt;span class=&quot;sy&quot;&gt;:pdi&lt;/span&gt;)].each &amp;amp;&lt;span class=&quot;sy&quot;&gt;:reload&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Discuss.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-03-04:4</id>
    <published>2007-03-04T23:29:00Z</published>
    <updated>2007-03-14T14:34:59Z</updated>
    <category term="Rails"/>
    <link href="http://blog.defsdoor.org/2007/3/4/everything-is-a-object" rel="alternate" type="text/html"/>
    <title>Everything is an object</title>
<content type="html">
            &lt;p&gt;Ok - this one is for anyone new to rubyonrails and struggling to come to terms with variables - especially if they've come from a traditional (none OO) language.&lt;/p&gt;

&lt;p&gt;In simple terms, there is only one variable type in ruby - a reference to an object. A pointer if you will.&lt;/p&gt;

&lt;p&gt;So, there is no option to pass something to a sub-routine by value - the default in most languages - everything is passed by reference.&lt;/p&gt;

&lt;p&gt;This usually raises the question of why, then, if passing - say - a string to a method,  aren't the changes made to the string reflected outside the method ?&lt;/p&gt;

&lt;p&gt;Take this code as an example -&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;alter_a_string&lt;/span&gt;(s)&lt;tt&gt;
&lt;/tt&gt; s = s + &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; cheese&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;t = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;I eat&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;alter_a_string(t)&lt;tt&gt;
&lt;/tt&gt;puts t&lt;tt&gt;
&lt;/tt&gt;=&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;I eat&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Why is this so if the variable was passed as a reference ?&lt;/p&gt;

&lt;p&gt;It's actually pretty simple why - the s = s + 'cheese' doesn't modify the object pointed to by s - it creates a new object based on s and appends 'cheese' to it.  + is a method on the String class that returns a new object.&lt;/p&gt;

&lt;p&gt;Methods that affect the object itself in ruby usually have ! at the end of their names to show this - such as String.chomp!&lt;/p&gt;

&lt;p&gt;The correct way to get our example above working as intended would be to use the &amp;lt;&amp;lt; method.  &amp;lt;&amp;lt; in ruby has been adopted as the append method.&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fu&quot;&gt;alter_a_string!&lt;/span&gt;(s)&lt;tt&gt;
&lt;/tt&gt; s &amp;lt;&amp;lt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; cheese&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;t = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;I eat&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;alter_a_string!(t)&lt;tt&gt;
&lt;/tt&gt;puts t&lt;tt&gt;
&lt;/tt&gt;=&amp;gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;I eat cheese&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
          </content>  </entry>
  <entry xml:base="http://blog.defsdoor.org/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.defsdoor.org,2007-03-04:2</id>
    <published>2007-03-04T16:44:00Z</published>
    <updated>2007-03-04T22:24:33Z</updated>
    <category term="Rails"/>
    <link href="http://blog.defsdoor.org/2007/3/4/want-to-learn-rubyonrails" rel="alternate" type="text/html"/>
    <title>Want to learn RubyOnRails ?</title>
<content type="html">
            &lt;p&gt;Spend a week on #rubyonrails.&lt;/p&gt;

&lt;p&gt;I'm not suggesting that you will learn from the answers others will give - although you probably will pick some things up.  No - what I am suggesting is get all your books, &lt;a href=&quot;http://api.rubyonrails.org&quot;&gt;websites&lt;/a&gt; and &lt;a href=&quot;http://www.google.com&quot;&gt;Google&lt;/a&gt; by your side and start answering some of the questions asked there.&lt;/p&gt;

&lt;p&gt;I've had the wind taken from my sails this last week due to what seems to be a old bug resurfacing with &lt;a href=&quot;http://dev.rubyonrails.org/ticket/7675&quot;&gt;cookies' expiry dates&lt;/a&gt; so I've spent most of my time helping others.&lt;/p&gt;

&lt;p&gt;It seems that the best skill to have in any role in life is the ability to find stuff out.  Some people seem to spend all day asking what would appear to be simple questions for which the answer is only a web search away but, instead, ask on irc and live with the inevitable delays that that would bring to their programming.&lt;/p&gt;

&lt;p&gt;The upside though is that I have learned a tremendous amount, and hopefully helped some people along the way.&lt;/p&gt;
          </content>  </entry>
</feed>
