<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Marty Haught</title>
    <link>http://martyhaught.com/rss/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>My blog covering software design.</description>
    
    
        <item>
          <title>Dev's Guide to Feedback Driven Development</title>
          <description>&lt;p&gt;This week I spoke at the &lt;a href=&quot;http://agile2010.agilealliance.org/&quot;&gt;Agile2010 Conference&lt;/a&gt; in Orlando, FL.  This is a large software conference that focuses on Agile methodologies.  This is my first time coming to a conference focused on Agile as I usually attend technical conferences only.  I was inspired to submit a talk when I saw some requests on twitter that more technical presentations to be submitted.  Given that I&amp;#8217;ve been passionate about Lean Startup techniques it made sense to submit a talk on the technical angles of the approach.  I figured it would be something new that no one else would likely cover.  I was right and they accepted my talk.&lt;/p&gt; &lt;p&gt;My talk was on Wednesday and it went fairly well.  I posted my slides on Slideshare &lt;a href=&quot;http://www.slideshare.net/mghaught/devs-guide&quot;&gt;here&lt;/a&gt;.  My goal with the talk was to show 4 fundamental techniques that you use to collect feedback to drive your product&amp;#8217;s direction.  &lt;a href=&quot;http://twitter.com/ericries&quot;&gt;Eric Ries&lt;/a&gt; has talked about all these techniques a few times so my talk was hardly original.  However, I did feel that there wasn&amp;#8217;t a central, easy to understand, step-by-step guide to putting them together.  That&amp;#8217;s what I was shooting for.  I did want to include more code in the talk but I only had an hour and still needed to give enough background to make sense of the practices.&lt;/p&gt;
&lt;p&gt;The two things that I wish I had done differently was to do less bullets and focus less on the startup model.  My audience was more corporate IT and thus don&amp;#8217;t have the same circumstances as startups.  That being said they do have plenty of reason to use FbDD to make their product development smarter.  The trade-off of the bullets is that my slides are fairly useful on their own.  Matter of fact, the slides are getting a fair amount of attention beyond the conference which I find flattering.  Hopefully they&amp;#8217;ll be useful.&lt;/p&gt;
&lt;p&gt;As a follow-up, I plan to release my Net Promoter Score gem/plugin for others to use in the near future.  I&amp;#8217;m also happy to share other bits of code from my examples if you&amp;#8217;re interested.&lt;/p&gt;</description>
          <pubDate>Fri, 13 Aug 2010 08:37:09 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/08/13/devs-guide-to-feedback-driven-development/</guid>
          <link>http://martyhaught.com/articles/2010/08/13/devs-guide-to-feedback-driven-development/</link>
        </item>
    
        <item>
          <title>Toy Story 3 - Savor the Present</title>
          <description>&lt;p&gt;I recently went to see Toy Story 3 with my wife and 6 year old son.  We really enjoyed the movie as it was well done.  However, I found the movie to be a touch bit sad.  I&amp;#8217;m not sure if others felt that but I surely did.  As I pondered this, it came down the process of Andy truly saying good-bye to his toys.  I believe there&amp;#8217;s also the sadness of his mother seeing him off to college.  As the parent of two children, I&amp;#8217;m am aware that this same day will be coming soon.  My oldest will turn 12 in August, which means we have another 6 years to go.  Those years will go by fast.  Matter of fact, we&amp;#8217;re 2/3rds the way through having our daughter at home.  It is perhaps for this reason that the movie touches me a bit more in a sad way.&lt;/p&gt; &lt;p&gt;This &amp;#8216;end of an era&amp;#8217;, as I like to think of it, that happens in more than just with children.  I felt this when I graduated high school, discharging out of the Army and a few times when I left jobs at companies where I had been working with a team for several years.  Some of these situations are less dramatic and heartfelt since our bonds weren&amp;#8217;t as close.  But the feeling is still the same.&lt;/p&gt;
&lt;p&gt;Why would I mention all of this?  Well, the lesson here is to appreciate what you have in the present moment and savor those relationships before they pass on.  Don&amp;#8217;t lose sight of spending quality time with your friends and family in pursuit of something less important in the long run.  I&amp;#8217;m in the middle of a 5 day long family vacation to South Dakota.  These are precious days and while I could have been working for my clients, I&amp;#8217;m happy that I&amp;#8217;m not.  My children will only be 6 and 11 once and the fun we&amp;#8217;re having on this trip is priceless.  Think about those things in your lives and evaluate if you&amp;#8217;ve got your priorities straight.  I&amp;#8217;d be happy to trade in great sums of potential income for more valuable family capital that I could be investing.&lt;/p&gt;</description>
          <pubDate>Fri, 16 Jul 2010 22:36:42 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/07/16/toy-story-3---savor-the-present/</guid>
          <link>http://martyhaught.com/articles/2010/07/16/toy-story-3---savor-the-present/</link>
        </item>
    
        <item>
          <title>June recap</title>
          <description>&lt;p&gt;I&amp;#8217;ve had a few blog posts at the tip of my fingers in June and never got around to getting them finished.  Such are things when you&amp;#8217;re incredibly busy.  The last couple months have been crazy busy but in a good way.  I&amp;#8217;m now starting to catch up and decided I should give my blog some attention.  The biggest reason for being so busy was RailsConf and my lean tutorial.  Let&amp;#8217;s start there.&lt;/p&gt; &lt;h3&gt;RailsConf 2010&lt;/h3&gt;
&lt;p&gt;RailsConf was a great time.  It was probably the best RailsConf to date.  I think in terms of quality, social events and content it was tops.  The very first RailsConf back in 2006 was so unique and new that it&amp;#8217;ll hold a special place in my heart.  I was fairly new to the Ruby community at that point that it was really hard to top.  I won&amp;#8217;t go into specifics about the conference though.&lt;/p&gt;
&lt;p&gt;I will discuss my tutorial some.  On Monday, I did a 3 hour tutorial on Lean practices.  I knew it would be a lot of work but I ended up spending almost all my free time and several work days getting it all together.  A good chunk more than I had planned for.  The good thing about running your own business is that you can rearrange things if you need to.  I also had a nice break between two large projects so that also helped.  I know a lot of attendees got value out of the tutorial and there were the usual &amp;#8216;haters&amp;#8217; that didn&amp;#8217;t care for it.  With such a niche topic there&amp;#8217;s not much you can do about that.  In hindsight and knowing some of the technical issues that the tutorial would face, I would have done things a bit differently.  RailsConf didn&amp;#8217;t record any video of the tutorials or normal sessions so the best I can offer up are my slides, &lt;a href=&quot;http://www.slideshare.net/mghaught/get-lean-tutorial&quot;&gt;here&lt;/a&gt;.  There were some cool &lt;a href=&quot;http://m.flickr.com/#/photos/jessmartin/4679890187/sizes/l/in/set-72157624102458541/&quot;&gt;handwritten&lt;/a&gt; &lt;a href=&quot;http://m.flickr.com/#/photos/jessmartin/4680527832/sizes/l/in/set-72157624102458541/&quot;&gt;notes&lt;/a&gt; done by &lt;a href=&quot;http://roadsafar.com/&quot;&gt;Jess Martin&lt;/a&gt; of my tutorial too.&lt;/p&gt;
&lt;h3&gt;mountain.rb&lt;/h3&gt;
&lt;p&gt;The most exciting topic for June was &lt;a href=&quot;http://mountainrb.com/&quot;&gt;mountain.rb&lt;/a&gt;, the Colorado Ruby conference I&amp;#8217;m organizing for October.  I launched a single page website during RailsConf.  The conference received an enthusiastic response and lots of questions about when we&amp;#8217;d announce a call for proposals and when registration would be open.  I&amp;#8217;ve been working on the conference planning over the last few weeks trying to get those two things ready.  First, we do have a conference hotel, &lt;a href=&quot;http://mountainrb.com/&quot;&gt;Hotel Boulderado&lt;/a&gt;.  Come late July we should have all the paperwork in place with a discounted room rate so those that want can book their room.  I am just wrapping up the sponsorship prospectus and hopefully will have that available early next week.  After that I&amp;#8217;ll get the call for proposals written up and released.  Finally, I hope to have registration open by August.  I&amp;#8217;m still finalizing the budget so until that&amp;#8217;s done I can&amp;#8217;t set the registration price.&lt;/p&gt;
&lt;h3&gt;Facebook Follow-up&lt;/h3&gt;
&lt;p&gt;If you&amp;#8217;ve been reading my blog recently you&amp;#8217;ll recall I mentioned a follow-up post for my Facebooker tutorial. Being busy has delayed getting this out for sure, but along with that the Facebook &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; is shifting greatly with the &lt;a href=&quot;http://developers.facebook.com/docs/opengraph&quot;&gt;Open Graph&lt;/a&gt; release.  Facebooker itself is changing, though it looks like they&amp;#8217;ve make a &lt;a href=&quot;http://github.com/mmangino/facebooker2&quot;&gt;new library&lt;/a&gt; instead of try to make the existing gem work with both apis.  I still intend to finish the second post as I had already done 80% of the work.  Ironically the good stuff, as I saw it, was in the second post anyway but I needed to give enough groundwork to make the tutorial complete.  I would say look for it in the next week but who knows as mountain.rb has the higher priority on my free time right now.&lt;/p&gt;
&lt;h3&gt;What&amp;#8217;s Next&lt;/h3&gt;
&lt;p&gt;Speaking of free time, I don&amp;#8217;t seem to do a very good job at keeping that free.  I have two conferences in August, &lt;a href=&quot;http://www.bizconf.org/&quot;&gt;BizConf&lt;/a&gt; and &lt;a href=&quot;http://agile2010.agilealliance.org/&quot;&gt;Agile2010&lt;/a&gt;.  I have some work to do for my talk at Agile2010 and BizConf is just for me and improving my business skills.  More importantly, family keeps me really busy during the summer.  Between t-ball, swimming, getting to the mountains with the kids as well as simply enjoying summer, more of the daylight hours are pulled away from work.  We have a wonderful vacation to South Dakota planned in July too.  I wouldn&amp;#8217;t change this though.  Family time is precious especially because you only get one shot at spending time with your kids at this age.  My oldest is 11 and it&amp;#8217;s just zoomed by.  Work will always be there and all it takes is setting and honoring the priorities in your life.  I&amp;#8217;ve had to tell several clients no recently as I simply didn&amp;#8217;t have the time for them.  It&amp;#8217;s also the reason why other blog posts never happened.  I love to share with you things I&amp;#8217;m passionate about and might help you in some fashion.  But it&amp;#8217;s just lower on the priority list and that&amp;#8217;s okay.  With my conference speaking schedule almost done, I&amp;#8217;ll have more time for other pursuits!&lt;/p&gt;</description>
          <pubDate>Wed, 30 Jun 2010 23:03:05 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/06/30/june-recap/</guid>
          <link>http://martyhaught.com/articles/2010/06/30/june-recap/</link>
        </item>
    
        <item>
          <title>May Lean Startup Circle with Eric Ries</title>
          <description>&lt;p&gt;Next week the Boulder Lean Startup Circle is having an impromptu meeting with &lt;a href=&quot;http://www.startuplessonslearned.com/&quot;&gt;Eric Ries&lt;/a&gt;.  This happened fairly last minute as Eric let me know he was coming to town and would enjoy meeting the group.  The meeting will be Thursday May 27th starting at 6:30pm.  Dinner and drinks are being provided by our generous sponsors of &lt;a href=&quot;http://www.returnpath.net/&quot;&gt;Return Path&lt;/a&gt; and &lt;a href=&quot;http://www.techstars.org/&quot;&gt;Techstars&lt;/a&gt;.  Having such a supportive community makes organizing meetings like this a dream.  We do have limited space so I&amp;#8217;m &amp;#8216;selling&amp;#8217; tickets to the event via &lt;a href=&quot;http://mayboulderleanstartup.eventbrite.com/&quot;&gt;EventBrite&lt;/a&gt;.  If you&amp;#8217;re interested in coming, please go over &lt;a href=&quot;http://mayboulderleanstartup.eventbrite.com/&quot;&gt;there&lt;/a&gt; and sign up for free.  I&amp;#8217;m sure they won&amp;#8217;t last long.&lt;/p&gt;
&lt;p&gt;The meeting should be a blast and I look forward to seeing you all there.&lt;/p&gt;</description>
          <pubDate>Thu, 20 May 2010 20:50:08 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/05/20/may-lean-startup-circle-with-eric-ries/</guid>
          <link>http://martyhaught.com/articles/2010/05/20/may-lean-startup-circle-with-eric-ries/</link>
        </item>
    
        <item>
          <title>RailsConf 2010 Lean Tutorial</title>
          <description>&lt;p&gt;I am busy putting my &lt;a href=&quot;http://en.oreilly.com/rails2010/public/schedule/detail/13851&quot;&gt;lean development RailsConf tutorial&lt;/a&gt; together but the general shape of the tutorial is done.  You can find a &lt;a href=&quot;http://github.com/mghaught/getlean&quot;&gt;&lt;span class=&quot;caps&quot;&gt;README&lt;/span&gt;&lt;/a&gt; that covers the structure and what you need to get started.  I recommend you look it over if you&amp;#8217;re coming to the tutorial.  The title is Get Lean: Slimming Down with Rails and will include topics such as minimum viable product, split testing, continuous deployment, kanban and more.  I will also have a sample app that we can play with as we work with these concepts.  I&amp;#8217;ve got two weeks left to wrap things up but this should be a fun session.&lt;/p&gt;</description>
          <pubDate>Wed, 19 May 2010 10:50:59 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/05/19/railsconf-2010-lean-tutorial/</guid>
          <link>http://martyhaught.com/articles/2010/05/19/railsconf-2010-lean-tutorial/</link>
        </item>
    
        <item>
          <title>Red Dirt Ruby Conference</title>
          <description>&lt;p&gt;Last week I attended a refreshing and enjoyable regional Ruby conference.  &lt;a href=&quot;http://reddirtrubyconf.com/&quot;&gt;Red Dirt Ruby Conference&lt;/a&gt; broke from the comfortable mold of other regional Ruby conferences and their gamble worked.  As a speaker at this conference I wasn&amp;#8217;t sure how it would play out and was anxious to see the new format in play.  I was not disappointed at all and was so impressed that it may well shape how the current forming Colorado Ruby conference is organized.&lt;/p&gt; &lt;p&gt;Before I get into the specifics of this conference I want to say what an impressive job the team in Oklahoma did to pull this off.  James Edward Gray II, Dana Gray, Derrick Parkhurst and Grant Schofield put together a well-run technical conference.  Kudos to all of you as I know that&amp;#8217;s not easy.  It&amp;#8217;s also quite the feat to get such talented speakers and attendees to fly in from across the country into Oklahoma.  Thank you all for your efforts.&lt;/p&gt;
&lt;p&gt;So what about this conference was so different?  The first was having super short talks.  Most talks were 15 minutes long.  No questions, just bring up the next speaker.  We worked in 4 speaker blocks with all four of us sitting at a table right beside the podium.  The switch between speakers took less than a minute and sometimes only 15-20 seconds. We were grouped in blocks by subject and after it was done there was a moderated list of questions for the panel.&lt;/p&gt;
&lt;p&gt;The shorter talks worked great.  It forced speakers to hone their message and quickly get to the point.  My talk felt super fast but as I was eliminating slides it gave me the freedom to go for the high quality content over trying to cover everything.  It also meant that if a talk came up that wasn&amp;#8217;t so interesting, it didn&amp;#8217;t matter as much since it&amp;#8217;s only 15 minutes.&lt;/p&gt;
&lt;p&gt;The question and answer session for each block was also a smashing success.  While the talks were going on, the audience was directed to send questions to James via twitter, irc or email.  irc seemed to be the best format as sometimes others in the channel would answer the question.  James was able to pick the best questions and ask them in an efficient and intelligent way that made great use of the panel&amp;#8217;s time.  There was also some nice interplay between the four panelists as one might expect.&lt;/p&gt;
&lt;p&gt;The conference also did other things right such as have a hash trading game where you traded hex &amp;#8216;cards&amp;#8217; to match a hash based off your name.  It encouraged folks to go up and interact with other attendees to get the right cards.  Some even got prizes for matching their hash though they had limited supplies and ran out quickly.  The size of the conference was very intimate with around 100 people in attendance.  Food was fabulous and the wifi quality was great.  It seemed all the things important for a technical conference they got right.&lt;/p&gt;
&lt;p&gt;My only complaint was that it was too short.  The pace of the conference seemed pretty fast too but that&amp;#8217;s usually how good conferences are.  Anyway, I look forward to seeing what comes next for Red Dirt.  I just feel bad for those that weren&amp;#8217;t there but I do understand you can &lt;a href=&quot;http://reddirtrubyconf.com/purchase_video&quot;&gt;get the video&lt;/a&gt; if you wish.&lt;/p&gt;</description>
          <pubDate>Tue, 11 May 2010 20:59:46 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/05/11/red-dirt-ruby-conference/</guid>
          <link>http://martyhaught.com/articles/2010/05/11/red-dirt-ruby-conference/</link>
        </item>
    
        <item>
          <title>Facebook Connect with Facebooker</title>
          <description>&lt;p&gt;I&amp;#8217;ve recently done two Facebook Connect integrations for my clients and found a lack of accurate instructions on how to wire things up with &lt;a href=&quot;http://github.com/mmangino/facebooker&quot;&gt;Facebooker&lt;/a&gt;.  Facebooker still appears to be the easiest, most complete Ruby library for interfacing with Facebook so I&amp;#8217;m going to write up instructions based on what I&amp;#8217;ve done.  Warning, as Facebook seems to often change its &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; at a whim this post may become inaccurate in the future, &lt;span class=&quot;caps&quot;&gt;YMMV&lt;/span&gt;.&lt;/p&gt; &lt;p&gt;A quick update now that I&amp;#8217;m done with this post.  I thought it would be shorter but it turned into a full blown tutorial.  I kept finding that I needed to give examples and explain things further to be of use.  I also have broken it into parts.  This first part will get you started with Facebook Connect.  It&amp;#8217;s not a five minute read but if you want to see the fine details of using Facebook Connect with Rails, this should get you well down that road!  As always, comments and questions are welcome.  If you have found a better way of doing something here, please share it with the rest of us.&lt;/p&gt;
&lt;h3&gt;About Facebook Connect&lt;/h3&gt;
&lt;p&gt;These instructions are meant for integrating a stand-alone Rails 2.3x application with Facebook using Facebook Connect.  The reasons you would do this vary but the two main reasons I see is that you want your app to interact with Facebook by tapping a user&amp;#8217;s friend list and publishing content to their stream.  Another nice benefit is that you don&amp;#8217;t have to handle authentication or user activation beyond wiring up a few calls to Facebook.  I&amp;#8217;ve seen a rise in stand alone applications using Facebook Connect over the past several months and more and more clients are asking to take advantage of the Facebook platform.  Additionally, Facebook has a pretty extensive &lt;a href=&quot;http://wiki.developers.facebook.com/index.php/Main_Page&quot;&gt;developers wiki&lt;/a&gt; which is full of detail but overwhelming when you&amp;#8217;re just starting out.&lt;/p&gt;
&lt;p&gt;Hopefully this tutorial can help understand the best way for a Rails app to do Facebook Connect integration.&lt;/p&gt;
&lt;h3&gt;Create your Facebook App&lt;/h3&gt;
&lt;p&gt;One of your first steps is to log into Facebook and create an application with this url: &lt;a href=&quot;http://www.facebook.com/developers/createapp.php&quot;&gt;Create Application&lt;/a&gt;. If you haven&amp;#8217;t already added the &amp;#8220;Developer&amp;#8221; app, you&amp;#8217;ll be asked to allow access.  Click Allow as this is how you will manage your application&amp;#8217;s Facebook settings going forward.  You may end up on the developers application page in which case you&amp;#8217;ll need to hit the &amp;#8220;Set Up New Application&amp;#8221; button.  Otherwise, you&amp;#8217;ll land on the create application page.  Either way, you&amp;#8217;ll be asked for a name, which can be whatever you want to remember it by and agreement with their terms.  I do highly recommend you actually read their terms of service as they will come after you if they catch you violating them.  A fellow developer in Boulder recently had some unpleasant contact with their legal department over a violation.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/content/fb_app_creation.png&quot; title=&quot;Facebook create application screen&quot; alt=&quot;Facebook create application screen&quot; /&gt;&lt;/p&gt;
&lt;p&gt;One other piece of advice is that I would make separate development and production Facebook applications to work with.  This will simplify your life in configuring your different environments and let you keep dev/testing concerns out of your production Facebook app.  It is totally possible to have just a single Facebook application for all environments but I&amp;#8217;ve found I didn&amp;#8217;t care for that.  Besides, creating Facebook apps is super simple and there&amp;#8217;s no drawback that I can tell to making lots of them.&lt;/p&gt;
&lt;p&gt;The next page will land on the &amp;#8216;Basic&amp;#8217; tab and will hold two very important pieces of information.  Copy down your &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; Key and Secret.  You will need these to authenticate calls from your Rails application to Facebook.  There are plenty of other things you&amp;#8217;ll want to update here but they don&amp;#8217;t matter for getting started and you can come back to them whenever you want.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/content/fb_basic_tab.png&quot; title=&quot;Facebook basic tab screen&quot; alt=&quot;Facebook basic tab screen&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Oh, finding your way back to your application&amp;#8217;s Facebook settings page is not obvious.  You&amp;#8217;ll need to click the &amp;#8220;Applications&amp;#8221; link on the side bar of your Facebook home page.  That lists all the apps you&amp;#8217;ve installed.  There you can click on the &amp;#8220;Developer&amp;#8221; application.  On the Developer home page, you&amp;#8217;ll see a right side bar that lists your applications.  Click your app and you&amp;#8217;re back to the profile page for it.&lt;/p&gt;
&lt;p&gt;Alright, back to finishing the app settings.  Another thing to note is that during this settings section, you only have to hit the &amp;#8220;Save Changes&amp;#8221; button at the bottom once you&amp;#8217;re done.  The left tabs will keep your form data as you switch between sections.  Feel free to explore the other tabs but we&amp;#8217;ll be concerned with only one other tab for now, Connect.&lt;/p&gt;
&lt;p&gt;On the Connect tab, you&amp;#8217;ll be setting the urls for your FB Connect Rails application.  If you don&amp;#8217;t update this then your FB connection buttons will fail.  The two most important fields are Connect &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; and Base Domain. You&amp;#8217;ll probably want to set up the rest but we can do that later.  The Connect &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; is the url to your Rails application.  I personally use passenger for local development and I&amp;#8217;ve gotten into this pattern:  http://local.&lt;mydomainname&gt;.com.  This plays very nice with Facebook&amp;#8217;s connect configuration as I can match everything on the same base domain.  Note, the Connect &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; needs to end in a /.&lt;/p&gt;
&lt;p&gt;The other important piece here is the Base Domain.  Here you&amp;#8217;d enter your &lt;domainname&gt;.com.  This lets you have different subdomains work with the FB Connect dialogs.  Thus you can set the Connect &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; as your testing or production domain (with a valid &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; entry so Facebook can find it) but FB Connect will work with a different subdomain (local.xxx in my case).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/content/fb_connect_tab.png&quot; title=&quot;Facebook connect tab screen&quot; alt=&quot;Facebook connect tab screen&quot; /&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s it for now.  Hit &amp;#8220;Save Changes&amp;#8221; and move on to installing Facebooker.  If you were building a canvas app or something that needed callbacks from Facebook you would need to add additional settings.&lt;/p&gt;
&lt;h3&gt;Install Facebooker&lt;/h3&gt;
&lt;p&gt;I&amp;#8217;ll assume you already have a Rails application set up as I&amp;#8217;m not going to cover getting started with Rails here.  For development we&amp;#8217;ll want to make sure that the base domain matches how you&amp;#8217;re accessing the app through your browser.&lt;/p&gt;
&lt;p&gt;I prefer to install Facebooker as a plugin with the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
script/plugin install git://github.com/mmangino/facebooker.git
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Please do look over the &lt;a href=&quot;http://github.com/mmangino/facebooker&quot;&gt;Facebooker readme&lt;/a&gt; on Github for more details on other ways to install it.&lt;/p&gt;
&lt;p&gt;Once the plugin is installed there will be a config file in config/facebooker.yml that you need to edit.  You&amp;#8217;ll notice that three environments are started for you.  We&amp;#8217;ll just work with the development settings.  Add your &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; Key and Secret.  Since we&amp;#8217;re building a Facebook connect site set set_asset_host_to_callback_url to false. Save your changes.&lt;/p&gt;
&lt;p&gt;The last piece is we need to generate the xd_receiver file.  This is necessary for Facebook Connect to work.  You can generate it with the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
script/generate xd_receiver
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add the two files it generates (public/xd_receiver.html and public/xd_receiver_ssl.html) to your repo as you&amp;#8217;ll need them in the future.&lt;/p&gt;
&lt;h3&gt;Login&lt;/h3&gt;
&lt;p&gt;Following &amp;#8216;the simplest thing that will work&amp;#8217; philosophy, let&amp;#8217;s add the FB Connect button to your Rails app.  The first part will be to add two helpers to the &lt;span class=&quot;caps&quot;&gt;HEAD&lt;/span&gt; section of the page. Usually this would go into your layout file but you might dynamically add it in with a content_for block if you don&amp;#8217;t want the facebook javascript includes on all pages.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= fb_connect_javascript_tag %&amp;gt;
  &amp;lt;%= init_fb_connect &quot;XFBML&quot; %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The init_fb_connect method defaults to using Prototype but you can override this to another library of choice, such as jquery.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= init_fb_connect &quot;XFBML&quot;, :js =&amp;gt; :jquery %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, in the part of the page where you want the connect button to appear use the following helper.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= fb_login_button %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When clicked the FB Connect button pops up a new window where Facebook handles the login process.  If successful, it will set some cookies that our application can use to determine if a Facebook user is signed in.  One optional thing with the fb_login_button is that we can register a javascript callback.  You&amp;#8217;ll see this often in many of the fb connect interactions.  Here&amp;#8217;s a simple example that will reload the page to the root of the domain.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= fb_login_button(&quot;window.location = '/';&quot;) %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For a more complex example here I set a form variable to know that the fb_user link has been established.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= fb_login_button('$(&quot;#fb_user_set&quot;).val(true); 
    $(&quot;#fb_account_container&quot;).html(&quot;FB user linked. Save required.&quot;);')%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These are nice options to have as you may want something to happen on the page once the user has successfully logged into Facebook.  Without setting any sort of callback, the page will do nothing after they&amp;#8217;ve logged in which may not be the experience you&amp;#8217;re looking for.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/content/connect_button_example.png&quot; title=&quot;Example app with FB Connect button&quot; alt=&quot;Example app with FB Connect button&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, in case you aren&amp;#8217;t getting this to work there are some things to check.  First, I have seen mention that the Facebook Connect library works best in valid html with the proper doctype.  I personally have been doing both in all my apps for years so I don&amp;#8217;t know what would happen if you didn&amp;#8217;t.  You might also get some Facebook errors such as invalid argument or other issues with domains or the cross domain receiver file.  The best thing to do there is verify the settings in your facebooker.yml file with the settings on Facebook and your development host address.  If that doesn&amp;#8217;t cut it you can seek out help in the &lt;a href=&quot;http://groups.google.com/group/facebooker&quot;&gt;Facebooker Google group&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Accessing the Facebook User&lt;/h3&gt;
&lt;p&gt;Now that you&amp;#8217;ve enabled a way to log in a Facebook user, let&amp;#8217;s get at that data.  Facebooker provides two methods that do the heavy lifting.  Add these to your application_controller.rb&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  before_filter :set_facebook_session
  helper_method :facebook_session
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Those experienced with Rails will guess correctly what these do.  For the rest of us, this will automatically look for those cookies on all requests and create a facebook_session that we can access in both the controller and view layer.  Now that the facebook session has been created and is accessible we can play with it.  We&amp;#8217;ll enhance the template to display the user if logged in, otherwise give them the fb connect button.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  &amp;lt;p&amp;gt;
    &amp;lt;% if facebook_session %&amp;gt;
      Welcome, &amp;lt;%= facebook_session.user.name %&amp;gt;
      &amp;lt;%= fb_profile_pic facebook_session.user %&amp;gt;
    &amp;lt;% else %&amp;gt;
      &amp;lt;%= fb_login_button %&amp;gt;
    &amp;lt;% end %&amp;gt;  
  &amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, I&amp;#8217;ve checked for the presence of the Facebook session and in the case that it exists, show the logged in user&amp;#8217;s Facebook name.  You can also see I added in a call to fb_profile_pic for our user.  This will display their profile picture (or a default image if they haven&amp;#8217;t set one).  Otherwise, I offer the FB Connect button.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/content/logged_in_example.png&quot; title=&quot;Example app with user profile picture and name&quot; alt=&quot;Example app with user profile picture and name&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Associating FB Users&lt;/h3&gt;
&lt;p&gt;Next I am going to cover how you would tie this Facebook user to your own user model.  For a basic Facebook Connect site, you&amp;#8217;ll only need to tie the Facebook user uid to your existing User model.  Facebook user uids are bigints so you&amp;#8217;ll need to do a special migration to get this right.  Here&amp;#8217;s the example for mysql:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  def self.up
    change_table :users do |t|
      t.integer :fb_uid
    end
    #if mysql
    execute(&quot;alter table users modify fb_uid bigint&quot;) 
  end 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Run your migration and your user is now ready to accept the fb_uid.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s some controller code for pulling the uid out of the facebook_session, assigning it to our user, and saving it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  current_user.fb_uid = facebook_session.user.uid
  current_user.save
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Most likely you&amp;#8217;ll want to add a check for the facebook_session into your authentication code.  Here&amp;#8217;s an example from restful_authentication plugin:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  def current_user
    @current_user ||= (login_from_session || login_from_basic_auth || 
      login_from_cookie || login_from_fb) unless @current_user == false
  end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can see that I added &amp;#8216;login_from_fb&amp;#8217; to the end of the chain.  It just checks for the facebook session and loads the appropriate User.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
  # helper method for authentication code
  def login_from_fb
    if facebook_session &amp;amp;&amp;amp; facebook_session.user
      begin
        User.find_by_fb_uid(facebook_session.user.uid)
      rescue Exception =&amp;gt; e
        logger.warn &quot;FB ERROR while logging in - #{e}&quot;
        return nil
      end  
    end
  end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;At this point you have a way to create and access a Facebook session from your Rails app, and can automatically authenticate application users based on this session.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll stop here for the first part.  The next post will focus on permissions, publishing and offline access.&lt;/p&gt;</description>
          <pubDate>Tue, 20 Apr 2010 14:34:49 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/04/20/facebook-connect-with-facebooker/</guid>
          <link>http://martyhaught.com/articles/2010/04/20/facebook-connect-with-facebooker/</link>
        </item>
    
        <item>
          <title>Colorado Ruby Conference</title>
          <description>&lt;p&gt;As I announced at last night&amp;#8217;s &lt;a href=&quot;http://boulderruby.org&quot;&gt;Boulder Ruby&lt;/a&gt; meeting, I will be organizing a Colorado-based Ruby conference in October.  Though there are no hard details yet, I am planning to have it be in Boulder around the 7th-8th of October.  I&amp;#8217;m going to be a bit creative for this conference so it won&amp;#8217;t be like all the other hotel conference-spaced tech conferences.  I am looking to keep a Colorado feel to it.  The conference is primarily for our strong local Ruby community but I will make it worthwhile to travel to for all out of state folks.  As soon as I have more details I&amp;#8217;ll make another post.&lt;/p&gt; </description>
          <pubDate>Wed, 17 Mar 2010 16:44:22 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/03/17/colorado-ruby-conference/</guid>
          <link>http://martyhaught.com/articles/2010/03/17/colorado-ruby-conference/</link>
        </item>
    
        <item>
          <title>Speaking at Red Dirt Ruby Conference</title>
          <description>&lt;p&gt;Following up on my RailsConf speaking announcement, I&amp;#8217;ll also be speaking at the &lt;a href=&quot;http://reddirtrubyconf.com/&quot;&gt;Red Dirt Ruby Conference&lt;/a&gt; in Oklahoma in early May.  I&amp;#8217;ll be presenting in the Rails 3 group on Active Record.  I only have 15 minutes so it&amp;#8217;ll be a challenge to pack all the new features into a quick (and fun) talk.&lt;/p&gt;</description>
          <pubDate>Thu, 04 Mar 2010 22:46:17 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/03/04/speaking-at-red-dirt-ruby-conference/</guid>
          <link>http://martyhaught.com/articles/2010/03/04/speaking-at-red-dirt-ruby-conference/</link>
        </item>
    
        <item>
          <title>Testing Delayed Job email sends</title>
          <description>&lt;p&gt;On one of my projects, we are using &lt;a href=&quot;http://github.com/collectiveidea/delayed_job&quot;&gt;Delayed Job&lt;/a&gt; to send emails when someone posts a topic to a forum that many users can be montoring.  Delayed Job is fantastic but as part of our test suite we had been testing the output of the notification email.  When introducing Delayed Job that made the testing aspect trickier.&lt;/p&gt; &lt;p&gt;Below is our approach in testing this solution.  The project is using Test:Unit so there is rspec goodness here. Also, we opted not to mock in this case.&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/300611.js?file=testing+Delayed+Job+email+sends&quot;&gt;&lt;/script&gt;&lt;p&gt;On line 2 you can see we use the assert_difference with the Delayed::Job.count method to see that a row indeed gets added.&lt;/p&gt;
&lt;p&gt;Line 6 uses the Rails assert_emails block as you usually would but to trigger the email send we use the work_off method to only send and then exit.&lt;/p&gt;
&lt;p&gt;The remainder of the gist does usual pattern matching with the email body returned from ActionMailer::Base.deliveries.&lt;/p&gt;</description>
          <pubDate>Wed, 10 Feb 2010 11:01:42 GMT</pubDate>
          <guid>http://martyhaught.com/articles/2010/02/10/testing-delayed-job-email-sends/</guid>
          <link>http://martyhaught.com/articles/2010/02/10/testing-delayed-job-email-sends/</link>
        </item>
    
    
  </channel>
</rss>

