<?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>Stefan Goodchild &#187; Ruby on Rails</title>
	<atom:link href="http://stefangoodchild.com/tag/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefangoodchild.com</link>
	<description>Old Enough To Know Better</description>
	<lastBuildDate>Wed, 18 Aug 2010 10:43:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Rails, Clearance, Subdomains and Remember Me?</title>
		<link>http://stefangoodchild.com/journal/2010/08/rails-clearance-subdomains-and-remember-me/</link>
		<comments>http://stefangoodchild.com/journal/2010/08/rails-clearance-subdomains-and-remember-me/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 10:41:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://stefangoodchild.com/?p=540</guid>
		<description><![CDATA[Been building a side project in Rails 2.3.8 recently and found that whilst getting the session cookie to work across subdomains is pretty trivial the Remember Me? cookie used by Clearance isn&#8217;t, especially for someone new to it like I am. Some fiddling around and some StackOverflow browsing led me to a pattern that solved [...]]]></description>
			<content:encoded><![CDATA[<p>Been building a side project in <a href="http://rubyonrails.org/">Rails 2.3.8</a> recently and found that whilst getting the session cookie to work across subdomains is pretty trivial the Remember Me? cookie used by <a href="http://github.com/thoughtbot/clearance">Clearance</a> isn&#8217;t, especially for someone new to it like I am. Some fiddling around and some <a href="http://stackoverflow.com/">StackOverflow</a> browsing led me to a pattern that solved my problems which I&#8217;ve published below for&nbsp;reference.</p>
<p>Just put the following into your environments (the period before the domain name is the key&nbsp;here)</p>
<pre class="brush: ruby">
COOKIE_DOMAIN = &#039;.yourdomain&#039;

if ActionController::Base.session
  ActionController::Base.session[:domain] = COOKIE_DOMAIN
else
  ActionController::Base.session = { :domain =&gt; COOKIE_DOMAIN }
end
</pre>
<p>And put the following into config/initializers/clearance_override.rb and restart and you should be&nbsp;golden.</p>
<pre class="brush: ruby">
Clearance::Authentication::InstanceMethods.module_eval do
  def remember(user)
    user.remember_me!
    cookies[:remember_token] = { :value   =&gt; user.token,
                                 :expires =&gt; user.token_expires_at,
                                 :domain =&gt; COOKIE_DOMAIN }
  end

  def forget(user)
    user.forget_me! if user
    cookies.delete(:remember_token, :domain =&gt; COOKIE_DOMAIN)
    reset_session
  end
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://stefangoodchild.com/journal/2010/08/rails-clearance-subdomains-and-remember-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Infocow</title>
		<link>http://stefangoodchild.com/portfolio/2010/06/infocow/</link>
		<comments>http://stefangoodchild.com/portfolio/2010/06/infocow/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 14:39:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Front]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://stefangoodchild.com/?p=521</guid>
		<description><![CDATA[Infocow connects young people with useful stuff to help take control of life - sites, stories, information and&#160;inspiration. Worked on the front end code and UI design with Nicolas Alpi and Ed Davey developing the back end on this project for Futurelab. Was a great experience with lots of brilliant feedback and user testing done [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><a href="http://www.infocow.org.uk/">Infocow</a> connects young people with useful stuff to help take control of life - sites, stories, information and&nbsp;inspiration.</p></blockquote>
<p>Worked on the front end code and UI design with <a href="http://www.notgeeklycorrect.com/">Nicolas Alpi</a> and Ed Davey developing the back end on this project for <a href="http://www.futurelab.org.uk/">Futurelab</a>. Was a great experience with lots of brilliant feedback and user testing done by Futurelab feeding into the Agile development methodology we use here at&nbsp;<a href="http://jivatechnology.com/">Jiva</a>.</p>
<p><img src="http://stefangoodchild.com/wp-content/uploads/2010/06/infocowresourcegrid.jpg" alt="" title="infocowresourcegrid" width="468" height="468" class="alignnone size-full wp-image-523" /></p>
]]></content:encoded>
			<wfw:commentRss>http://stefangoodchild.com/portfolio/2010/06/infocow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorhub</title>
		<link>http://stefangoodchild.com/portfolio/2010/05/tutorhub/</link>
		<comments>http://stefangoodchild.com/portfolio/2010/05/tutorhub/#comments</comments>
		<pubDate>Mon, 17 May 2010 15:49:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Front]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://stefangoodchild.com/?p=477</guid>
		<description><![CDATA[The project I have been product managing and designing for nearly 9 months now has entered private beta. Tutorhub is a website built to connect tutors and students. Built on a number of cutting edge technologies detailed over at the Jiva website this is something new in the market place and allows secure one to [...]]]></description>
			<content:encoded><![CDATA[<p>The project I have been product managing and designing for nearly 9 months now has entered private beta. <a href="http://tutorhub.com/">Tutorhub</a> is a website built to connect tutors and students.  Built on a number of cutting edge technologies detailed over at the <a href="http://jivatechnology.com/miscellaneous/2010/04/xmpp-jabber-bosh-and-all-that/">Jiva website</a> this is something new in the market place and allows secure one to one tutoring sessions to take place using a familiar instant messaging&nbsp;interface.</p>
<p><img src="http://stefangoodchild.com/wp-content/uploads/2010/05/tutorhub.jpg" alt="" title="tutorhub" width="468" height="468" class="alignnone size-full wp-image-478" /></p>
<p>The private beta is now live and we are looking for students and tutors to start&nbsp;testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://stefangoodchild.com/portfolio/2010/05/tutorhub/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SpecializeIn</title>
		<link>http://stefangoodchild.com/portfolio/2009/08/specializein/</link>
		<comments>http://stefangoodchild.com/portfolio/2009/08/specializein/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 16:47:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://stefangoodchild.com/?p=341</guid>
		<description><![CDATA[Design and front end development for SpecializeIn.com, the project I am product managing at&#160;Jiva]]></description>
			<content:encoded><![CDATA[<p>Design and front end development for <a href="http://specializein.com">SpecializeIn.com</a>, the project I am product managing at&nbsp;<a href="http://jivatechnology.com">Jiva</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://stefangoodchild.com/portfolio/2009/08/specializein/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
