<?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; forms</title>
	<atom:link href="http://villageidiotmedia.com/tag/forms/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>
	</channel>
</rss>
