<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Scott Blaine</title>
	
	<link>http://scottblaine.com</link>
	<description>A man on a mission</description>
	<lastBuildDate>Wed, 21 Oct 2009 01:00:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blaisco" /><feedburner:info uri="blaisco" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>How I Evaluate Business Ideas</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/usU0DAWQCyc/how-i-evaluate-business-ideas</link>
		<comments>http://scottblaine.com/how-i-evaluate-business-ideas#comments</comments>
		<pubDate>Wed, 21 Oct 2009 01:00:02 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[strategy]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=384</guid>
		<description><![CDATA[Scotchel.com didn&#8217;t work out and I was itching to find an idea that I was passionate about and transform it into reality. When I was looking for business ideas last time I searched online (there is no end to the amount of business ideas you can find online) and compiled a list of potential projects. [...]]]></description>
			<content:encoded><![CDATA[<p>Scotchel.com didn&#8217;t work out and I was itching to find an idea that I was passionate about and transform it into reality. When I was looking for business ideas last time I searched online (there is no end to the amount of business ideas you can find online) and compiled a list of potential projects. While that gave me lots of ideas for projects I was one level removed from all of them. They were ideas, but they weren&#8217;t <em>my</em> ideas.</p>
<p>This time I wanted it to be my idea. I started thinking about the problems I had in my life: I have a (<em>relatively</em>) long commute to work, my email and calendar apps are a sort of shoddy, makeshift to-do system, I&#8217;m horrible at remembering names, dates, and other miscellaneous facts, I fairly frequently find myself with a table of data and dreading using MS Excel to make a chart out of it, etc. I took a half-hour out of my day a few times and started listing the small annoyances in my life. Pretty soon I had a good list of possible projects.</p>
<p>Much like last time I took my list and axed things that I had little interest in or things that required skills I didn&#8217;t have and didn&#8217;t want to learn. That narrowed down my list into things that I wanted to work on and could reasonably execute on. However, I&#8217;d been through this idea listing process before and ultimately I ended up choosing a business idea that wasn&#8217;t right for me. Somewhere in the process of choosing a project from that filtered list I&#8217;d made a mistake.</p>
<p>I realized that the criteria I had used to choose a project last time hadn&#8217;t been very effective. I needed something new; something that would help me find a business idea I&#8217;d be more successful with. Thinking through the mistakes of last time I came up with four criteria to help me choose a new project:</p>
<ul>
<li>Excitement (Low/Medium/High): This is an indication how excited I am to work on the project. Any project with a low excitement level I immediately throw out. And a &#8220;medium&#8221; is a bit of a warning sign for me. It basically means that my interest in the project could start to tail off after a while, so if I don&#8217;t think I&#8217;ll be able to execute on the idea quickly I shouldn&#8217;t consider the project.</li>
<li>Complexity (Low/Medium/High): This indicates a couple things: technical difficulty and scope of the project. It gives me some indication of how quickly I could execute on a project. I decided that a project with medium excitement and high complexity should be abandoned as I wouldn&#8217;t be able to complete the project by the time I would lose interest in it.</li>
<li>Dog food (Yes/No): This shows whether I personally would use the application or not (i.e. <a id="xidy" title="eat my own dogfood" href="http://en.wikipedia.org/wiki/Eating_one%27s_own_dog_food">eat my own dog food</a>). I think more than anything this is a requirement if you don&#8217;t have more than one founder. When you&#8217;re on your own you need to have a crystal clear vision of the problem and solution.*You don&#8217;t have a co-founder to bounce ideas off of and steer you back in the right direction if you get off course. If I have a project marked with a No, I toss it.</li>
<li>Non-Ad Revenue (Yes/No): This indicates whether or not the project has a viable revenue stream other than advertising. It&#8217;s not a requirement for a <em>project</em>, but it is a requirement for a <em>business</em>. In other words, if this column has a &#8220;no&#8221; I relegate it to being a hobby project that likely has no prospects for going any further than that. There&#8217;s nothing wrong with hobby projects, you just need to be aware that that&#8217;s what it is.</li>
</ul>
<p>I created a table with five columns, one column for the project name plus four columns for the criterion above and rated every project (one added bonus to using personal problems as business ideas is that all of the potential projects are &#8220;dog food projects&#8221;). After filtering out projects that were advertising-only, projects that had low excitement, and projects with medium excitement and high complexity, I was left with one idea that seemed viable.</p>
<p>*Note that there is an <em>excellent</em> chance that your solution is <em>wrong</em> and your users will be quick to tell you as much. Their advice is useful, don&#8217;t ignore it. Just make sure that there is always a clear vision for your product, even if that vision changes. Heading in too many directions at once is a sure-fire way to fail.</p>
<p>Next time: Market Analysis</p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/usU0DAWQCyc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/how-i-evaluate-business-ideas/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://scottblaine.com/how-i-evaluate-business-ideas</feedburner:origLink></item>
		<item>
		<title>Fail Fast</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/oWZUQ6mC71U/fail-fast</link>
		<comments>http://scottblaine.com/fail-fast#comments</comments>
		<pubDate>Sat, 17 Oct 2009 01:00:24 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[strategy]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=380</guid>
		<description><![CDATA[Around the time of my wedding I spent a lot of time thinking about scotchel.com. While I had made progress on it, I wasn&#8217;t moving nearly as quickly as I wanted. I&#8217;d moved the release date a few times, swapped technologies partway through, and incorporated new technology that I hadn&#8217;t originally thought about adding to [...]]]></description>
			<content:encoded><![CDATA[<p>Around the time of my wedding I spent a lot of time thinking about scotchel.com. While I had made progress on it, I wasn&#8217;t moving nearly as quickly as I wanted. I&#8217;d moved the release date a few times, swapped technologies partway through, and incorporated new technology that I hadn&#8217;t originally thought about adding to the site. None of these events were bad in and of themselves. There are good reasons to move dates, swap technologies, and change your plans as you go. But when you start seeing a repeating pattern of delaying launch it&#8217;s a good indication that you&#8217;ve got some problems. Your number one goal in any startup should be to launch something quickly and build from there. If you don&#8217;t launch the application your chances of failure are 100%.</p>
<p>So with these red flags in the back of my mind I thought about what the larger problem was. The first issue is that I wasn&#8217;t passionate about the idea. There are some major problems with current dating sites and lots of room for improvement. But at the end of the day working to improve dating wasn&#8217;t something that excited me. At least not to to the point that I wanted to work on it day after day for months on end. Strike one.</p>
<p>The second issue was that I would never be one of the end-users of my application (note the &#8220;my wedding&#8221; part above). Again, not necessarily an issue if you have a good grasp of the problem and you&#8217;re in touch with lots of would-be users of your application. However, I <em>wasn&#8217;t</em> in touch with lots of would-be users, and I wasn&#8217;t particularly motivated to go out and meet a bunch more. Strike two.</p>
<p>The third issue is that I hadn&#8217;t done my due diligence in solidifying a solid revenue stream <em>other than advertising</em>. There&#8217;s nothing wrong with having advertising as your main source of income, but advertising is generally a lot more effective when you already have a decent membership base using your website. I was starting with zero users. Meaning the only way to monetize the site would be to rapidly build a user base. Strike three.</p>
<p>With all of that in mind I decided that it was no longer a good idea to pursue scotchel.com. It was a hard decision but it ultimately feels right. It is a lot better to fail now than to invest increasingly larger amounts of time on the project and fail later. It is <em>always </em>better to fail fast.</p>
<p>Next time: Evaluating Business Ideas</p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/oWZUQ6mC71U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/fail-fast/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://scottblaine.com/fail-fast</feedburner:origLink></item>
		<item>
		<title>Married with Children</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/X--1P9LWolo/married-with-children</link>
		<comments>http://scottblaine.com/married-with-children#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:00:26 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=378</guid>
		<description><![CDATA[Yesterday Rachel and I had the reception for our wedding. We had wisely given ourselves a few weeks of time between the wedding in St. Lucia and our reception here in Omaha. I said wisely, but really it was only wise in hindsight. I thought we would be able to relax a bit before our [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday Rachel and I had the reception for our wedding. We had wisely given ourselves a few weeks of time between the wedding in St. Lucia and our reception here in Omaha. I said wisely, but really it was only wise in hindsight. I thought we would be able to relax a bit before our reception come upon us. But no, the reception details were all-consuming. I&#8217;m not sure how anyone gets anything accomplished in the days leading up to a wedding/reception.</p>
<p>For anyone that is considering getting married in the future, I have to say that eloping* is definitely the way to go. You only have to worry about yourselves and that makes everything ridiculously easier. There&#8217;s only two people to please instead of 100+. In that same vein I wish we&#8217;d done something simpler for the reception. Our dinner, while fantastic, would have been much less stress-inducing with a simple buffet or cocktail party. And if you have a child or children, leave them with the grandparents (or hire a sitter) the evening before and the day of your wedding/reception. The two of you will have enough to worry about without your kids running around demanding your attention.</p>
<p>In an upcoming post I&#8217;ll talk about the future of <a title="Scotchel.com" href="http://scotchel.com">scotchel.com</a> and where I&#8217;m headed next.</p>
<p>*I just looked up <em>elope</em> and the one of the first definitions is <em>to run off secretly to get married, usually without the consent of one&#8217;s parents.</em> To be clear, we <em>did</em> have the consent of our parents. I wonder if there&#8217;s a similar word that is <em>with consent</em>. And not <em>secretly</em>.</p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/X--1P9LWolo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/married-with-children/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://scottblaine.com/married-with-children</feedburner:origLink></item>
		<item>
		<title>Out until the 23rd</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/BF01w1q120E/out-until-the-23rd</link>
		<comments>http://scottblaine.com/out-until-the-23rd#comments</comments>
		<pubDate>Sun, 13 Sep 2009 23:25:52 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=374</guid>
		<description><![CDATA[I&#8217;ve been spending a lot of time the last couple of weeks getting ready to get married (it&#8217;s amazing how much preparation is involved!). Rachel and I are leaving tomorrow for St. Lucia (in the Caribbean) and we&#8217;ll be getting married on the 19th. I won&#8217;t be back until the 23rd, so don&#8217;t expect to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending a lot of time the last couple of weeks getting ready to get married (it&#8217;s amazing how much preparation is involved!). Rachel and I are leaving tomorrow for <a title="St. Lucia - Google Maps" href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=St.+Lucia&amp;sll=13.909444,-60.978893&amp;sspn=0.399239,0.891953&amp;g=St+.+Lucia&amp;ie=UTF8&amp;ll=13.909444,-60.978893&amp;spn=3.193523,7.13562&amp;t=h&amp;z=8">St. Lucia (in the Caribbean)</a> and we&#8217;ll be getting married on the 19th. I won&#8217;t be back until the 23rd, so don&#8217;t expect to hear from me until then <img src='http://scottblaine.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/BF01w1q120E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/out-until-the-23rd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://scottblaine.com/out-until-the-23rd</feedburner:origLink></item>
		<item>
		<title>Image-free tabs with clean CSS</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/_nDOO_rQjjg/image-free-tabs-with-clean-css</link>
		<comments>http://scottblaine.com/image-free-tabs-with-clean-css#comments</comments>
		<pubDate>Sun, 30 Aug 2009 01:00:17 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[tabs]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=370</guid>
		<description><![CDATA[It&#8217;s slightly amazing to me how hard it is to find someone that has image-free tabs that have clean CSS. I found a lot of articles on sliding-door tabs (requiring images) and a few articles that required CSS for each individual tab (yuck!). And what I wanted wasn&#8217;t even complex:

Simple, right? I sure wasn&#8217;t going [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s slightly amazing to me how hard it is to find someone that has image-free tabs that have clean CSS. I found a lot of articles on sliding-door tabs (requiring images) and a few articles that required CSS for each individual tab (yuck!). And what I wanted wasn&#8217;t even complex:</p>
<p><a href="http://scottblaine.com/wp-content/uploads/2009/08/tabs.png"><img class="alignnone size-full wp-image-371" title="tabs" src="http://scottblaine.com/wp-content/uploads/2009/08/tabs.png" alt="tabs" width="260" height="52" /></a></p>
<p>Simple, right? I sure wasn&#8217;t going to go reinvent the wheel by writing my own CSS for them though. Thankfully after searching for a bit I came across <a title="CSS Mini Tabs (the UN-tab, tab)" href="http://www.simplebits.com/bits/minitabs.html">SimpleBits&#8217; Mini Tabs</a>. I didn&#8217;t want mini-tabs, but the HTML and CSS was remarkably clean. Only 4 CSS declarations on a simple HTML list with a class=&#8221;active&#8221; for the current tab. With some modification to the CSS I was able to come up with tabs that looked like the above (even looks good in IE7, amazingly).</p>
<p>So, if you want some decent looking/functioning tabs go yank the HTML/CSS from the above link.</p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/_nDOO_rQjjg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/image-free-tabs-with-clean-css/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://scottblaine.com/image-free-tabs-with-clean-css</feedburner:origLink></item>
		<item>
		<title>I’m not dead yet</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/7mvXZHgTdkE/im-not-dead-yet</link>
		<comments>http://scottblaine.com/im-not-dead-yet#comments</comments>
		<pubDate>Thu, 27 Aug 2009 01:00:24 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[strategy]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=368</guid>
		<description><![CDATA[Today I was reading an article by Paul Graham on How Not to Die. The basic premise is that if your startup doesn&#8217;t die, you&#8217;ll get rich. And the main indication of a dying startup is a lack of communication. No update in a couple months? Bad. No response to emails? Really bad.
I hadn&#8217;t updated [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000000;"><span style="font-family: Georgia,&quot;Times New Roman&quot;,&quot;Bitstream Charter&quot;,Times,serif;">Today I was reading <a title="How Not to Die" href="http://www.paulgraham.com/die.html">an article by Paul Graham on How Not to Die</a>. The basic premise is that if your startup doesn&#8217;t die, you&#8217;ll get rich. And the main indication of a dying startup is a lack of communication. No update in a couple months? Bad. No response to emails? Really bad.</span></span></p>
<p><span style="color: #000000;"><span style="font-family: Georgia,&quot;Times New Roman&quot;,&quot;Bitstream Charter&quot;,Times,serif;">I hadn&#8217;t updated my blog in more than a week and as I mentioned a while back <a title="How I stay motivated" href="http://scottblaine.com/how-i-stay-motivated">blogging is one of the ways I keep myself motivated</a>. Thus, not updating my blog is a red flag to myself. Thankfully I&#8217;ve made a fair bit of progress lately. I took a few hours on Saturday and hammered on the site at an <a title="Panera Bread" href="http://www.panerabread.com/">undisclosed location</a> (makes me wish Jailbreak Omaha were around&#8230; (it&#8217;s the end of summer guys, where are you?! <img src='http://scottblaine.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). They were the most productive hours I can remember in recent history, and I plan to do it again.</span></span><br />
Progress wise I&#8217;m almost back to where I was before I switched from PHP to Ruby on Rails. It&#8217;s hard to tell if I&#8217;m quicker in RoR than I am in PHP because I&#8217;m reusing a lot of the logic/decisions from the first time, but if I had to take a guess I&#8217;m say I&#8217;m moving quicker. I&#8217;m definitely writing a lot less code and things just seem to make more sense. I can see where CodeIgniter was pulling concepts from Rails (and they do a good job of it), but the PHP/CodeIgniter combination seems a lot more clunky than Ruby/Rails.</p>
<p>Anyway, given another weekend or so I think I&#8217;ll have completed everything I had in PHP and will be moving on to new and better things. Next up on the docket is building the view and edit profile pages which should be fairly straightforward (*knock on wood*).</p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/7mvXZHgTdkE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/im-not-dead-yet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://scottblaine.com/im-not-dead-yet</feedburner:origLink></item>
		<item>
		<title>No news is good news?</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/4xd2_HmtsUY/no-news-is-good-news</link>
		<comments>http://scottblaine.com/no-news-is-good-news#comments</comments>
		<pubDate>Mon, 17 Aug 2009 05:00:52 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=366</guid>
		<description><![CDATA[I haven&#8217;t posted in a while mainly because I haven&#8217;t had anything news worthy. I&#8217;m learning a lot about Rails to be sure and I&#8217;ve nearly rebuilt what I had in PHP. I&#8217;m slowly chipping away at the site, getting a little more done every day.
An October release looms close; I&#8217;m not sure I&#8217;ll make [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t posted in a while mainly because I haven&#8217;t had anything news worthy. I&#8217;m learning a lot about Rails to be sure and I&#8217;ve nearly rebuilt what I had in PHP. I&#8217;m slowly chipping away at the site, getting a little more done every day.</p>
<p>An October release looms close; I&#8217;m not sure I&#8217;ll make it with the time lost switching to Rails, but I still think it was ultimately the right decision to switch. RoR has been much more enjoyable to program in. I write less code yet accomplish more. Plugging in various bits of code is a breeze. It makes me wish I&#8217;d taken a look at RoR a few years ago.</p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/4xd2_HmtsUY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/no-news-is-good-news/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://scottblaine.com/no-news-is-good-news</feedburner:origLink></item>
		<item>
		<title>How to use additional one-to-one models with restful_authentication</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/WJ-Gih4w2Us/how-to-use-additional-one-to-one-models-with-restful_authentication</link>
		<comments>http://scottblaine.com/how-to-use-additional-one-to-one-models-with-restful_authentication#comments</comments>
		<pubDate>Sun, 09 Aug 2009 01:00:03 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[restful_authentication]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=345</guid>
		<description><![CDATA[Restful_authentication collects some basic information to get an account set up, like a username, email address, and password, which all gets stored in a User model. What if you have some additional information that you&#8217;d like to collect upon registration, and you don&#8217;t want to store it in the User model (addresses, for example)? Rails [...]]]></description>
			<content:encoded><![CDATA[<p>Restful_authentication collects some basic information to get an account set up, like a username, email address, and password, which all gets stored in a User model. What if you have some additional information that you&#8217;d like to collect upon registration, and you don&#8217;t want to store it in the User model (addresses, for example)? Rails 2.3 makes this easy.</p>
<p>Let&#8217;s get an example registration app set up:</p>
<pre>rails registration
ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/restful_authentication
ruby script/generate authenticated user sessions</pre>
<p>Cool, now you have your registration app set up with a Users model, controller, and view. If you start up your server and head to http://localhost:3000/users/new/ you should see a very basic registration form. Let&#8217;s add our Address model. For the sake of brevity, I&#8217;m just going to create a field that references the User model and one field for a zip code, but you get the idea.</p>
<pre>ruby script/generate model Address user:references zipcode:string
rake db:migrate</pre>
<p>With our Address model in place, we need to let the User model know that it is linked to the Address model. Here&#8217;s what the User model looks like (\app\models\user.rb):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'digest/sha1'</span>
<span style="color:#9966CC; font-weight:bold;">class</span> User <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  <span style="color:#008000; font-style:italic;"># Virtual attribute for the unencrypted password</span>
  attr_accessor <span style="color:#ff3333; font-weight:bold;">:password</span>
&nbsp;
  validates_presence_of     <span style="color:#ff3333; font-weight:bold;">:login</span>, <span style="color:#ff3333; font-weight:bold;">:email</span>
  <span style="color:#008000; font-style:italic;"># lots more stuff that we're not going to worry about...</span></pre></td></tr></table></div>

<p>We&#8217;re going to add three things:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'digest/sha1'</span>
<span style="color:#9966CC; font-weight:bold;">class</span> User <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  has_one <span style="color:#ff3333; font-weight:bold;">:address</span>
  accepts_nested_attributes_for <span style="color:#ff3333; font-weight:bold;">:address</span>
  attr_accessible <span style="color:#ff3333; font-weight:bold;">:address_attributes</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Virtual attribute for the unencrypted password</span>
  attr_accessor <span style="color:#ff3333; font-weight:bold;">:password</span>
&nbsp;
  validates_presence_of     <span style="color:#ff3333; font-weight:bold;">:login</span>, <span style="color:#ff3333; font-weight:bold;">:email</span>
  <span style="color:#008000; font-style:italic;"># lots more stuff that we're not going to worry about...</span></pre></td></tr></table></div>

<p>We&#8217;ve told the User model that (1) it has one Address model, (2) that it should save data for Address automagically, and (3) that the address_attributes fields are permitted fields to receive data for (if you read through the code a bit further you&#8217;ll see another attr_accessible line, you could add address_attributes there too).</p>
<p>We need to make one change to the User controller (\controllers\users_controller.rb) to prevent an &#8220;Called id for nil&#8221; error later on. At line 6 you should have an empty new method. We&#8217;re going to create an instance variable for User:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>6
7
8
9
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># render new.rhtml</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> new
    <span style="color:#0066ff; font-weight:bold;">@user</span> = User.<span style="color:#9900CC;">new</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Let&#8217;s now take a look at the one User view that restful_auth created (\app\views\users\new.html.erb):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span>= error_messages_for <span style="color:#ff3333; font-weight:bold;">:user</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
<span style="color:#006600; font-weight:bold;">&lt;%</span> form_for <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#ff3333; font-weight:bold;">:url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> users_path <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#006600; font-weight:bold;">-%&gt;</span>
&lt;p&gt;&lt;label for=&quot;login&quot;&gt;Login&lt;/label&gt;&lt;br/&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">text_field</span> <span style="color:#ff3333; font-weight:bold;">:login</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;label for=&quot;email&quot;&gt;Email&lt;/label&gt;&lt;br/&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">text_field</span> <span style="color:#ff3333; font-weight:bold;">:email</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;&lt;br/&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">password_field</span> <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;label for=&quot;password_confirmation&quot;&gt;Confirm Password&lt;/label&gt;&lt;br/&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">password_field</span> <span style="color:#ff3333; font-weight:bold;">:password_confirmation</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&nbsp;
&lt;p&gt;<span style="color:#006600; font-weight:bold;">&lt;%</span>= submit_tag <span style="color:#996600;">'Sign up'</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">-%&gt;</span></pre></td></tr></table></div>

<p>First of all, we need to change the form_for :user to be form_for @user. Second, we get to add in our zipcode field:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span>= error_messages_for <span style="color:#ff3333; font-weight:bold;">:user</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
<span style="color:#006600; font-weight:bold;">&lt;%</span> form_for <span style="color:#0066ff; font-weight:bold;">@user</span>, <span style="color:#ff3333; font-weight:bold;">:url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> users_path <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#006600; font-weight:bold;">-%&gt;</span>
&lt;p&gt;&lt;label for=&quot;login&quot;&gt;Login&lt;/label&gt;&lt;br/&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">text_field</span> <span style="color:#ff3333; font-weight:bold;">:login</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;label for=&quot;email&quot;&gt;Email&lt;/label&gt;&lt;br/&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">text_field</span> <span style="color:#ff3333; font-weight:bold;">:email</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;&lt;br/&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">password_field</span> <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;label for=&quot;password_confirmation&quot;&gt;Confirm Password&lt;/label&gt;&lt;br/&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">password_field</span> <span style="color:#ff3333; font-weight:bold;">:password_confirmation</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&nbsp;
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">build_address</span> <span style="color:#9966CC; font-weight:bold;">unless</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">address</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
<span style="color:#006600; font-weight:bold;">&lt;%</span> f.<span style="color:#9900CC;">fields_for</span> <span style="color:#ff3333; font-weight:bold;">:address</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>a<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
  &lt;p&gt;
    <span style="color:#006600; font-weight:bold;">&lt;%</span>= a.<span style="color:#9900CC;">label</span> <span style="color:#ff3333; font-weight:bold;">:zipcode</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    <span style="color:#006600; font-weight:bold;">&lt;%</span>= a.<span style="color:#9900CC;">text_field</span> <span style="color:#ff3333; font-weight:bold;">:zipcode</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
  &lt;/p&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
&nbsp;
&lt;p&gt;<span style="color:#006600; font-weight:bold;">&lt;%</span>= submit_tag <span style="color:#996600;">'Sign up'</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">-%&gt;</span></pre></td></tr></table></div>

<p>Here&#8217;s where I ran into the two gotcha&#8217;s. If you don&#8217;t switch form_for :user to form_for @user when you submit the form you&#8217;ll get a very unpleasant error that looks like this:</p>
<pre>
ActiveRecord::AssociationTypeMismatch in UsersController#create
Address(#46729050) expected, got HashWithIndifferentAccess(#23561230)
</pre>
<p>Second, if you don&#8217;t add in line 15, @user.build_address unless @user.address, you&#8217;ll get the following error when you try to view the form:</p>
<pre>
You have a nil object when you didn't expect it!
</pre>
<p><a href="http://www.pixellatedvisions.com/2009/03/18/rails-2-3-nested-model-forms-and-nil-new-record">More info on why that error occurs here</a>.</p>
<p>Anyway, with the above steps you should now have a registration form that creates records for both User and Address. If you found this helpful, leave a comment and let me know!</p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/WJ-Gih4w2Us" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/how-to-use-additional-one-to-one-models-with-restful_authentication/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://scottblaine.com/how-to-use-additional-one-to-one-models-with-restful_authentication</feedburner:origLink></item>
		<item>
		<title>View/Edit Profile Pages</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/Bc7kCGdWXHU/viewedit-profile-pages</link>
		<comments>http://scottblaine.com/viewedit-profile-pages#comments</comments>
		<pubDate>Fri, 31 Jul 2009 01:00:11 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[mockups]]></category>
		<category><![CDATA[profile]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=335</guid>
		<description><![CDATA[This week, when I wasn&#8217;t learning Ruby, I spent some time conceptualizing the profile pages. They ended up being very easy to put together (perhaps because I&#8217;m not collecting much information to being with). I&#8217;m a firm believer that you can do a lot with a little though and these pages will be easy to [...]]]></description>
			<content:encoded><![CDATA[<p>This week, when I wasn&#8217;t learning Ruby, I spent some time conceptualizing the profile pages. They ended up being very easy to put together (perhaps because I&#8217;m not collecting much information to being with). I&#8217;m a firm believer that you can do a lot with a little though and these pages will be easy to build out further if I decide I need to. Or, more accurately, if users tell me I need to <img src='http://scottblaine.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So, without further ado, here are the mockups:</p>
<div id="attachment_336" class="wp-caption alignnone" style="width: 310px"><a href="http://scottblaine.com/wp-content/uploads/2009/07/profile1.png"><img class="size-medium wp-image-336" title="profile1" src="http://scottblaine.com/wp-content/uploads/2009/07/profile1-300x172.png" alt="First view profile mockup" width="300" height="172" /></a><p class="wp-caption-text">First view profile mockup</p></div>
<div id="attachment_337" class="wp-caption alignnone" style="width: 310px"><a href="http://scottblaine.com/wp-content/uploads/2009/07/profile2.png"><img class="size-medium wp-image-337" title="profile2" src="http://scottblaine.com/wp-content/uploads/2009/07/profile2-300x194.png" alt="Second view profile mockup" width="300" height="194" /></a><p class="wp-caption-text">Second view profile mockup</p></div>
<div id="attachment_338" class="wp-caption alignnone" style="width: 310px"><a href="http://scottblaine.com/wp-content/uploads/2009/07/profile3.png"><img class="size-medium wp-image-338" title="profile3" src="http://scottblaine.com/wp-content/uploads/2009/07/profile3-300x156.png" alt="Edit account mockup" width="300" height="156" /></a><p class="wp-caption-text">Edit account mockup</p></div>
<div id="attachment_339" class="wp-caption alignnone" style="width: 310px"><a href="http://scottblaine.com/wp-content/uploads/2009/07/profile4.png"><img class="size-medium wp-image-339" title="profile4" src="http://scottblaine.com/wp-content/uploads/2009/07/profile4-300x158.png" alt="Edit profile mockup" width="300" height="158" /></a><p class="wp-caption-text">Edit profile mockup</p></div>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/Bc7kCGdWXHU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/viewedit-profile-pages/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://scottblaine.com/viewedit-profile-pages</feedburner:origLink></item>
		<item>
		<title>Switching to Ruby</title>
		<link>http://feedproxy.google.com/~r/blaisco/~3/jSXrMtc5xAY/switching-to-ruby</link>
		<comments>http://scottblaine.com/switching-to-ruby#comments</comments>
		<pubDate>Sun, 26 Jul 2009 01:00:16 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://scottblaine.com/?p=330</guid>
		<description><![CDATA[Whenever I was watching more TV than working on my Great Idea, it was because I was stuck. I didn&#8217;t realize it at the time, but my mind was avoiding making a tough decision or working through a particularly hard problem. My Internal FUD pushed me towards easier tasks. Watching TV was a whole lot [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Whenever I was watching more TV than working on my Great Idea, it was because I was stuck. I didn&#8217;t realize it at the time, but my mind was avoiding making a tough decision or working through a particularly hard problem. My Internal FUD pushed me towards easier tasks. Watching TV was a whole lot easier than spending a couple hours researching, thinking about, and making the tough call. <em>–<a title="7 lies that prevent Your Great Idea from becoming a Real Business" href="http://blog.liferemix.net/7-lies-prevent-your-great-idea-becoming-real-business">7 lies that prevent your great idea from becoming a real business</a></em></p></blockquote>
<p>Whenever I find myself not working on my project I come back to this quote, because it&#8217;s always true. Anytime I&#8217;m not working on <a title="Scotchel.com" href="http://scotchel.com/">scotchel.com</a> for any significant amount of time it&#8217;s because I&#8217;ve hit a roadblock. My current issue can be stated simply: do I continue building the site in PHP or do I switch over to Ruby on Rails?</p>
<p>The answer has been hard to come by, perhaps because I haven&#8217;t really sat down to think about it. But I was tired of being &#8220;stuck&#8221; so I spent an hour this morning reviewing why I might want to (or not want to) switch to Ruby. And, as of now, I&#8217;m going to make the switch to Ruby. I&#8217;ll try to get to the same place I left off in PHP (at the very least) and we&#8217;ll see how it goes. From what I&#8217;ve read, it should be both easier and more fun, so I&#8217;m looking forward to it.</p>
<img src="http://feeds.feedburner.com/~r/blaisco/~4/jSXrMtc5xAY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://scottblaine.com/switching-to-ruby/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://scottblaine.com/switching-to-ruby</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.513 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-01-23 11:51:06 -->
