<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>MettaProgramming &#187; authlogic</title>
	<atom:link href="http://mettadore.com/tag/authlogic/feed/" rel="self" type="application/rss+xml" />
	<link>http://mettadore.com</link>
	<description>Thoughts on Software and Technology</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:39:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Rails, Authlogic, and strange errors like &#8220;user_url&#8221;</title>
		<link>http://mettadore.com/ruby/rails-authlogic-and-strange-errors-like-user_url/</link>
		<comments>http://mettadore.com/ruby/rails-authlogic-and-strange-errors-like-user_url/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 06:52:15 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[authlogic]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[user_url]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=67</guid>
		<description><![CDATA[Alright, this may be obvious to you real rubologists, but I&#8217;ve only been programming in Ruby for about a week, and Rails is still a framework where I have to rebuild my projects frequently because I bork them so bad. My hope is that there&#8217;s someone else who&#8217;s as clueless as me. If that person [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, this may be obvious to you real rubologists, but I&#8217;ve only been programming in Ruby for about a week, and Rails is still a framework where I have to rebuild my projects frequently because I bork them so bad.</p>
<p>My hope is that there&#8217;s someone else who&#8217;s as clueless as me. If that person is out there, and happens to get strange errors with Rails, maybe using Authlogic, maybe this will help.</p>
<h3>ActionController::RoutingError in   Users#show</h3>
<p>Alright, so you&#8217;re building a Rails app, and you have no damn clue what the hell you&#8217;re doing, and you <em>still</em> decided to get all complicated and have completely useless and meaningless things like &#8220;users&#8221; and &#8220;sessions&#8221; and &#8220;logins.&#8221;</p>
<p>Well, it&#8217;s your own damn fault when you get some strange error like<sup><a href="http://mettadore.com/ruby/rails-authlogic-and-strange-errors-like-user_url/#footnote_0_67" id="identifier_0_67" class="footnote-link footnote-identifier-link" title="a full traceback is here, for you meatheads who actually get such an error">1</a></sup></p>
<pre class="brush: bash; title: ; notranslate">
user_url failed to generate from {:action=&gt;&quot;show&quot;, :controller=&gt;&quot;users&quot;}
</pre>
<p>especially when you <strong><em>know damn well that the frackin&#8217; controller is there and the show method works because you just used it 2 minutes ago and everything worked just find thank you very much</em></strong>!!!</p>
<p>Look, I told you it&#8217;s your own damn fault for getting complicated.</p>
<h3>Sessions are like cactuses, they&#8217;re pointy and hurt, but pretty in Ansel Adams pictures</h3>
<p>Yes, by the way, I know that the plural is technically cacti, but I&#8217;m going for comedic effect.</p>
<p>So, the deal is, the authentication token hangs around, and you&#8217;ve probably done something stupid like</p>
<pre class="brush: ruby; title: ; notranslate">
rake db:drop &amp;&amp; rake db:create &amp;&amp; rake db:migrate &amp;&amp; rake db:seed
</pre>
<p>just so that you could test some random thing that you don&#8217;t understand. Well, if you do that, and you&#8217;re using authlogic, and you don&#8217;t bother to logout before hand, your session token will remain live in the browser cache and then you will be totally screwed when you suddenly refresh your browser and get strange incomprehensible errors on a webapp that <em><strong>was working fine just thirty $*#(@*! seconds ago</strong></em>!!!</p>
<p>So, kill the server, flush the browser cache, and <em>then</em> do your crazy &#8220;let&#8217;s delete the entire damn database and fill it with the exact same information that it had in the first place because it makes us feel better&#8221; routine.<sup><a href="http://mettadore.com/ruby/rails-authlogic-and-strange-errors-like-user_url/#footnote_1_67" id="identifier_1_67" class="footnote-link footnote-identifier-link" title="By the way, I know this only because I have an incredibly deep understanding of the subtleties of this language, not because I&amp;#8217;d be stupid enough to spend the last few hours fighting with something that&amp;#8217;s so blatantly simple&hellip; just so you know.">2</a></sup></p>
<p>Because, as it turns out, it&#8217;s not the exact same information.</p>
<p>Sessions are a bitch.</p>
<ol class="footnotes"><li id="footnote_0_67" class="footnote">a full traceback is <a href="http://sqrl.it/?nfjoo">here</a>, for you meatheads who actually <em>get</em> such an error</li><li id="footnote_1_67" class="footnote">By the way, I know this only because I have an incredibly deep understanding of the subtleties of this language, not because I&#8217;d be stupid enough to spend the last few hours fighting with something that&#8217;s so blatantly simple… just so you know.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/ruby/rails-authlogic-and-strange-errors-like-user_url/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

