<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Village Idiot &#187; Tutorials</title>
	<atom:link href="http://villageidiotmedia.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://villageidiotmedia.com</link>
	<description>Because the Ruby community needs one</description>
	<lastBuildDate>Sun, 19 Apr 2009 07:09:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Location-aware &#8220;Cancel&#8221; buttons in forms</title>
		<link>http://villageidiotmedia.com/2009/01/location-aware-cancel-buttons-in-forms/</link>
		<comments>http://villageidiotmedia.com/2009/01/location-aware-cancel-buttons-in-forms/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 12:59:05 +0000</pubDate>
		<dc:creator>Bobby</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[forms]]></category>

		<guid isPermaLink="false">http://villageidiotmedia.com/?p=58</guid>
		<description><![CDATA[For a client app, I needed to have "Cancel" buttons in my forms, which would send the user back to the previous page he was on. The restful_authentication plugin generates authenticated_system.rb, which gives us the following methods:
[code='ruby']
# Store the URI of the current request in the session.
# We can return to this location by calling #redirect_back_or_default.
def store_location
session[:return_to] = request.request_uri
end

# Redirect to the URI stored by the most recent store_location call or
# to the passed default.  Set an appropriately modified
#   after_filter :store_location, :only => [:index, :new, :show, :edit]
# for any controller you want to be bounce-backable.
def redirect_back_or_default(default)
redirect_to(session[:return_to] &#124;&#124; default)
session[:return_to] = nil
end
[/code]]]></description>
		<wfw:commentRss>http://villageidiotmedia.com/2009/01/location-aware-cancel-buttons-in-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taking TOG out for a spin</title>
		<link>http://villageidiotmedia.com/2008/10/taking-tog-out-for-a-spin/</link>
		<comments>http://villageidiotmedia.com/2008/10/taking-tog-out-for-a-spin/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 13:14:39 +0000</pubDate>
		<dc:creator>Bobby</dc:creator>
				<category><![CDATA[Gems]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://villageidiotmedia.com/?p=38</guid>
		<description><![CDATA[A recent post about Tog got me curious, so I thought I'd give it a test drive. According to their site, you could add social networking functionalities as plugins, which is another approach from CommunityEngine (via Rails engines) and Insoshi (a Rails app). The instructions were a little vague, so I thought I'd document the process here (with a few errors along the way).]]></description>
		<wfw:commentRss>http://villageidiotmedia.com/2008/10/taking-tog-out-for-a-spin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scheduled tasks using BackgrounDRb</title>
		<link>http://villageidiotmedia.com/2008/09/scheduled-tasks-using-backgroundrb/</link>
		<comments>http://villageidiotmedia.com/2008/09/scheduled-tasks-using-backgroundrb/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 02:57:20 +0000</pubDate>
		<dc:creator>Bobby</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[background processes]]></category>

		<guid isPermaLink="false">http://villageidiotmedia.com/?p=17</guid>
		<description><![CDATA[A project I am working on required a background process to check and update subscriptions nightly, and send out billing emails to users with expiring subscriptions. I decided to use BackgrounDRb, a plugin perfectly suited for this task.
Setting up:
BackgronDRb runs as a separate server, but is just a process with access to all your Rails [...]]]></description>
		<wfw:commentRss>http://villageidiotmedia.com/2008/09/scheduled-tasks-using-backgroundrb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing validation errors</title>
		<link>http://villageidiotmedia.com/2008/09/hello-world/</link>
		<comments>http://villageidiotmedia.com/2008/09/hello-world/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 01:03:06 +0000</pubDate>
		<dc:creator>Bobby</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[validations]]></category>

		<guid isPermaLink="false">http://villageidiotmedia.com/?p=1</guid>
		<description><![CDATA[From my code snippets repo, found this snippet from here &#8211; it&#8217;s another way of adding your own error messages (or overriding the default ones Rails throws back).

class User &#60; ActiveRecord::Base
attr_accessor :password_confirmation, :mail_confirmation

before_validation_on_create &#039;self.class.validates_uniqueness_of :name, :message=&#62;“#{self.name} is not available”‘
before_validation_on_create ’self.class.validates_uniqueness_of :mail, :message=&#62;”#{self.mail} is already used by some other user”‘

def validate_on_create
errors.add_on_blank %w( name password mail )
errors.add_on_boundary_breaking(’name’, [...]]]></description>
		<wfw:commentRss>http://villageidiotmedia.com/2008/09/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
