<?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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Rails Dog</title>
	
	<link>http://railsdog.com/blog</link>
	<description>The Official Blog of the Rails Dog Developers</description>
	<pubDate>Mon, 05 Oct 2009 12:00:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.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" href="http://feeds.feedburner.com/railsdog" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Rails Dog is Officially Launched</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/euyXMz2UDeQ/</link>
		<comments>http://railsdog.com/blog/2009/10/rails-dog-is-officially-launched/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 12:00:09 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://railsdog.com/blog/?p=131</guid>
		<description><![CDATA[We&#8217;re proud to announce the launch of our new company, Rails Dog LLC.  RailsDog has been operating for a while now as a programming blog and as the sponsor of the open source e-commerce project known as Spree.  Demand for our professional e-commerce consulting services has now grown to the point where we [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re proud to announce the launch of our new company, Rails Dog LLC.  <a href="http://railsdog.com">RailsDog</a> has been operating for a while now as a programming blog and as the sponsor of the open source e-commerce project known as <a href="http://spreecommerce.com">Spree</a>.  Demand for our professional e-commerce consulting services has now grown to the point where we are able to organize as a company and lease physical office space here in Washington, DC.</p>

<p>Several experts from the Spree community have now joined our company full time and we have many more available to us in a subcontractor capacity.  We have also updated our website which we&#8217;ll be adding to in the coming weeks.  During this time period we will also be introducing you to some of our new team members.</p>

<p>Rails Dog will continue to sponsor the Spree e-commerce project as well as offer paid consulting services related to web applications development.  The Spree project will remain freely available under the terms of the BSD License.  October is going to be a busy month for us.  Our list of client projects is going to enable us to spend even more time focused on Spree and we hope to add several exciting new features this month. </p>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/10/rails-dog-is-officially-launched/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/10/rails-dog-is-officially-launched/</feedburner:origLink></item>
		<item>
		<title>Resource Controller for “Skinny” Rails Controllers</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/HI5Jc02fzA0/</link>
		<comments>http://railsdog.com/blog/2009/07/resource-controller-for-skinny-rails-controllers/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 13:46:33 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[resource_controller]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=119</guid>
		<description><![CDATA[These days it seems to be conventional wisdom to build &#8220;skinny&#8221; controllers in your Rails app.  Skinny controllers help you to consolidate your business logic into one place (the model) which allows for easier maintenance and testing.  If you&#8217;re still not convinced, perhaps you should watch this informative public service announcement. 

I&#8217;ve been [...]]]></description>
			<content:encoded><![CDATA[<p>These days it seems to be conventional wisdom to build &#8220;skinny&#8221; controllers in your Rails app.  Skinny controllers help you to consolidate your business logic into one place (the model) which allows for easier maintenance and testing.  If you&#8217;re still not convinced, perhaps you should watch this <a href="http://www.vimeo.com/1050762">informative public service announcement</a>. </p>

<p>I&#8217;ve been using the excellent <a href="http://github.com/giraffesoft/resource_controller/tree/master"><code>resource_controller</code></a> plugin by James Golick for well over a year now.  Its an excellent tool for handling the standard RESTful controller actions that one normally codes by hand (or generator.)  We currently use it in the <a href="http://spreecommerce.com">Spree</a> project and yesterday I was curious to compare the size of these controllers to those of a project that does not use <code>resource_controller</code>.  First lets look at the results of running <code>rake stats</code> on the Spree project.</p>

<p><img src="http://railsdog.com/blog/wp-content/uploads/2009/07/picture-3.png" alt="spree-stats" title="spree-stats" width="477" height="280" class="aligncenter size-full wp-image-116" /></p>

<p>As you can see, there are 44 controllers in this project.  Yeah, that&#8217;s a lot of controllers but Spree is a pretty huge project (its a full featured e-commerce platform.)  Now notice that out of 44 classes we only have 111 methods.  That&#8217;s an average (rounding down) of only 2 methods per class!  The methods themselves are also pretty skinny with an average of 8 lines of code per method.</p>

<p>Now lets take a look at <a href="http://www.fatfreecrm.com/">Fat Free CRM</a>.  I chose this project because it is similar to Spree in that its a full featured platform (not just a little plugin.)  <em>DISCLAIMER: I&#8217;ve never used this application but I&#8217;ve heard good things about it.  I&#8217;m in no way trying to disparage another person&#8217;s work here - I just need a point of comparison.</em></p>

<p><img src="http://railsdog.com/blog/wp-content/uploads/2009/07/picture-4.png" alt="fat-free-stats" title="fat-free-stats" width="467" height="282" class="aligncenter size-full wp-image-117" /></p>

<p>You can see that this project&#8217;s controllers are pretty fat.  There are only 12 of them but they have more lines of code then in the 44 controllers of Spree.  There are 11 methods per controller (compared to 2 in Spree), with the typical method size being the same as Spree.  Don&#8217;t let the equivalent method size fool you.  For instance, take a look at this typical 4 line method in a Spree controller.</p>

<pre><code class='ruby'>
create do
  flash nil 
  wants.html {redirect_to edit_order_url(@order)}
end
</code></pre>

<p>This is an example of how we override the default <code>resource_controller</code> behavior.  In this specific case we did not want to include anything in the flash, nor redirect to show after object creation.  If you&#8217;re happy with the <code>resource_controller</code> defaults, this method is not even needed.</p>

<p>If you&#8217;re interested in a thorough overview of <code>resource_controller</code>, Fabio Akita has produced a <a href="http://www.akitaonrails.com/2008/1/25/easy-restful-rails-screencast">very detailed screencast</a> on how it works.  Its one of the longest screencasts I&#8217;ve ever seen (about 1 hr) but its well worth the time if you&#8217;re struggling to wrap your head around how REST works in Rails (both with and without resource_controller.)</p>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/07/resource-controller-for-skinny-rails-controllers/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/07/resource-controller-for-skinny-rails-controllers/</feedburner:origLink></item>
		<item>
		<title>Using Rack to Combine Sinatra and Word Press</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/dRM37zsg0CM/</link>
		<comments>http://railsdog.com/blog/2009/06/using-rack-to-combine-sinatra-and-word-press/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 15:44:02 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[ruby sinatra wordpress php rack]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=67</guid>
		<description><![CDATA[There's been a lot of buzz recently around the lightweight Ruby framework known as [Sinatra](http://www.sinatrarb.com/).  It seems ideally suited for simple web applications that require a little sprinkle of Ruby and using the entire Ruby on Rails stack might be overkill.  You've probably also heard of [Rack](http://rack.rubyforge.org/) (unless you've been without Internet access for the past six months.)  If you're new to Rack and would like to learn more, you can check out this [excellent presentation](http://en.oreilly.com/rails2009/public/schedule/detail/7717) from RailsConf.  I recently had the need to build a website that featured a blog along with some minimal dynamic content so I thought I would try hooking up Sinatra together with the Word Press blog engine.]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a lot of buzz recently around the lightweight Ruby framework known as <a href="http://www.sinatrarb.com/">Sinatra</a>.  It seems ideally suited for simple web applications that require a little sprinkle of Ruby and using the entire Ruby on Rails stack might be overkill.  You&#8217;ve probably also heard of <a href="http://rack.rubyforge.org/">Rack</a> (unless you&#8217;ve been without Internet access for the past six months.)  If you&#8217;re new to Rack and would like to learn more, you can check out this <a href="http://en.oreilly.com/rails2009/public/schedule/detail/7717">excellent presentation</a> from RailsConf.  I recently had the need to build a website that featured a blog along with some minimal dynamic content so I thought I would try hooking up Sinatra together with the Word Press blog engine.</p>

<p><a href="http://wordpress.org">WordPress(WP)</a> is an excellent blogging platform.  Its the consensus tool of choice for professional bloggers (those who blog for a living as opposed to people like me who occassionally blog about technology.)   Since I was really happy with WP and I believe in using the best technology for the job, I wanted to see if I could get it working alongside Sinatra which I planned to use for the rest of the site.  Why not just do the whole thing in PHP?  Well the answer is that I hate programming in PHP.  I didn&#8217;t mind using an excellent tool like WP but I didn&#8217;t want to get carried away with the PHP when it came to my own coding.</p>

<p>First, you need to get WP up and running with <a href="http://httpd.apache.org/">Apache HTTP Server</a>.  You can use any server really but I would recommend Apache since its widely used and well documented when it comes to PHP applications.  There is no shortage of WP setup documentation so I&#8217;m not going to cover it here.  Just be sure to <a href="http://www.corvidworks.com/articles/giving-wordpress-its-own-directory">setup WP in its own directory</a> (<code>/blog</code>) instead of the top level root directory.  Once you can reach your WP blog via <code>http://example.com/blog</code> then you&#8217;re ready to proceed.</p>

<p>You&#8217;re also going to need to install <a href="http://www.modrails.com/">Phusion Passenger</a>.  I&#8217;m not going to cover installation of Passenger either since most Rails developers are already familiar with it.  If you&#8217;re not, I suggest you read some of the <a href="http://www.modrails.com/documentation.html">excellent documentation</a> on the subject.  What you may not know, however, is that Passenger also supports arbitrary Ruby web appications that follow the Rack interface (like say &#8230; Sinatra.)  So lets get started with a simple Rack app and then move onto Sinatra.</p>

<h2>Install the Rack Gem</h2>

<p>Lets make sure the rack gem is installed on our server.</p>

<pre>
<code>
gem install rack
</code>
</pre>

<h2>Create the Directories Required by Rack</h2>

<p>Suppose we are creating an application called <code>example</code> which is located in the <code>/webapps</code> directory</p>

<pre>
<code>
mkdir /webapps/example/public
mkdir /webapps/example/tmp
</code>
</pre>

<h2>Create a Basic Rackup File</h2>

<p>We also need to create a <code>/webapps/example/config.ru</code> for starting the Rack application</p>

<pre>
<code class="ruby">
app = proc do |env|
    return [200, { "Content-Type" => "text/html" }, "hello world"]
end
run app
</code>
</pre> 

<h2>Change the Document Root</h2>

<p>In the Apache config you will want to configure the <code>DocumentRoot</code> to point to the public directory in your Rack app (<code>/webapps/example/public</code>).  Leave your WP blog directory where it is for now.  Restart Apache.</p>

<p>If you navigate to your application in a web browser you should see the familiar &#8220;hello world&#8221; greeting.  This means Phusion and Rack are now working together without a problem.  Lets add Sinatra to the mix.</p>

<h2>Setup Sinatra</h2>

<p>Install the Sinatra gem if you haven&#8217;t done so already.</p>

<pre>
<code>
gem install sinatra
</code>
</pre>

<p>Replace your <code>config.ru</code> with one that will setup Sinatra</p>

<pre>
<code class="ruby">
require 'rubygems'
require 'sinatra'

Sinatra::Application.default_options.merge!(
  :run => false,
  :env => :production,
  :views => '/webapps/example'
)

require 'app.rb'
run Sinatra.application
</code>
</pre>  

<p>Now create an <code>app.rb</code> which will be the basis for your Sinatra app</p>

<pre>
<code class="ruby">
get '/' do
  'Hello Sinatra!'
end
</code>
</pre>  

<p>Restart Apache and navigate to your local application using your web browser you should now see the Sinatra greeting that we just added.</p>

<h2>Add the WP Blog</h2>

<p>Move your entire <code>blog</code> dir into your Sinatra public directory.  So you will now have <code>/webapps/example/public/blog</code> along with the original <code>.htacess</code> file used by WP.  Your blog won&#8217;t work yet, there&#8217;s an important tweak to be made to your <code>httpd.conf</code></p>

<pre>
<code>
&lt;Location /blog>
  PassengerEnabled off
&lt;/Location>
</code>
</pre>

<p>This tells Passenger not to bother with files in the <code>blog</code> directory.  This is key to getting the PHP-based WP blog to run inside of a directory where everything else is Sinatra.  If you test your application inside of a web browser the blog should be working!</p>

<h2>Build Out Your Sinatra Application</h2>

<p>Go ahead and build out the rest of your Sinatra application now.  Most likely you&#8217;re going to want to share a common layout, header and footer between your Sinatra application and your WP blog.  You can add &#8220;partial&#8221; support in Sinatra using a helper (Sinatra does not explicitly support partials.)</p>

<p>Modify your <code>app.rb</code> as follows:</p>

<pre>
<code class="ruby">
get '/' do
  @section = 'overview'
  erb :overview, :layout => :default
end

helpers do
  # Usage: partial :foo
  def partial(page, options={})
    erb page, options.merge!(:layout => false)
  end
end
</code>
</pre>

<p>Then you can create a <code>default.erb</code> to serve as the default layout.</p>

<pre>
<code class="ruby">
&lt;html&nbsp;xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&nbsp;dir=&quot;ltr&quot;&nbsp;lang=&quot;en-US&quot;&gt;
&lt;head&nbsp;profile=&quot;http://gmpg.org/xfn/11&quot;&gt;
&nbsp;&nbsp;&lt;meta&nbsp;http-equiv=&quot;Content-Type&quot;&nbsp;content=&quot;text/html;&nbsp;charset=UTF-8&quot;&nbsp;/&gt;
&nbsp;&nbsp;&lt;link&nbsp;rel=&quot;Shortcut&nbsp;Icon&quot;&nbsp;type=&quot;image/ico&quot;&nbsp;href=&quot;/blog/wp-content/themes/spree/favicon.ico&quot;&nbsp;/&gt;
&nbsp;&nbsp;&lt;title&gt;Spree&lt;/title&gt;
&nbsp;&nbsp;&lt;link&nbsp;rel=&quot;stylesheet&quot;&nbsp;href=&quot;/blog/wp-content/themes/spree/style.css&quot;&nbsp;type=&quot;text/css&quot;&nbsp;media=&quot;screen&quot;&nbsp;/&gt;
&lt;/head&gt;
&lt;body&gt;
&nbsp;&nbsp;&lt;div&nbsp;id=&quot;page&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;BEGIN:&nbsp;Header&nbsp;--&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;%=&nbsp;partial&nbsp;:header&nbsp;%&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;END:&nbsp;Header&nbsp;--&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id=&quot;main&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class=&quot;content&quot;&gt;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;%=&nbsp;yield&nbsp;%&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/p&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;BEGIN:&nbsp;Footer&nbsp;--&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;%=&nbsp;partial&nbsp;:footer&nbsp;%&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;END:&nbsp;Footer&nbsp;--&gt;
&nbsp;&nbsp;&lt;/div&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&lt;/body&gt;
&lt;/html&gt;
</code>
</pre>

<p>Notice how I am using the favicon and stylesheets right from the WP blog theme.  From this point on we&#8217;re just writing a nice Sinatra application and sharing styles and images with our WP blog.  </p>

<h2>Final Thoughts</h2>

<p>This is an excellent way to build a simple Ruby based website that requires a blog.  I started off by having my artist just work up a design for the WP blog since she could do that on her own without any Ruby.  I then copied the header and footer into my Sinatra app and created some stub ERB files for her to edit.  Sinatra worked out well for my very simple needs.  I basically needed a simple way to share layouts and to highlight the current navigation tab in my header.  </p>

<p>My artist was able to edit these ERB files in place because they were basically straight HTML.  All of the dynamic stuff was contained in the layout itself.  The end result is a seamless integration of Ruby + PHP where each technology is being used for what it does best.</p>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/06/using-rack-to-combine-sinatra-and-word-press/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/06/using-rack-to-combine-sinatra-and-word-press/</feedburner:origLink></item>
		<item>
		<title>A Public “Thank You”</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/m0_XZTtXCtM/</link>
		<comments>http://railsdog.com/blog/2009/05/a-public-thank-you/#comments</comments>
		<pubDate>Wed, 06 May 2009 06:04:19 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[GitHub]]></category>

		<category><![CDATA[Phusion]]></category>

		<category><![CDATA[RailsConf]]></category>

		<category><![CDATA[resource_controller]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=56</guid>
		<description><![CDATA[@GreggPollack put together an excellent RubyHeroes presentation before the keynote.  In addition to recognizing some of the great contributions these individuals made, Gregg suggested that we all take a moment to thank at least three people whose work has made our lives that much easier.  So instead of getting caught up in minor complaints about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/greggpollack">@GreggPollack</a> put together an excellent <a href="http://rubyheroes.com/">RubyHeroes</a> presentation before the keynote.  In addition to recognizing some of the great contributions these individuals made, Gregg suggested that we all take a moment to thank at least three people whose work has made our lives that much easier.  So instead of getting caught up in minor complaints about the accomodations or speeches, I decided to throw out some more positive energy.</p>

<ol>
<li><p><a href="http://github.com">GitHub</a> - I&#8217;m not going to waste a lot of space talking about how much of an impact GitHub has made on the Rails community.   Its not like these guys are toiling away in anonymity but their contribution has been so important that I&#8217;m just going to go on record as saying &#8220;Thanks.&#8221;</p></li>
<li><p><a href="http://blog.phusion.nl/">Phusion</a> - Again, everyone knows what these guys have done for simplifying Rails deployment.  Just because they get plenty of &#8220;Thank Yous&#8221; doesn&#8217;t mean I can&#8217;t throw my own two cents in here.  I also had the opportunity to thank one of the Phusion guys in person at dinner this evening.</p></li>
<li><p><a href="http://jamesgolick.com/resource_controller.html">ResourceController</a> - James Golick&#8217;s plugin finally convinced me to embrace REST.  If you&#8217;re not familiar with it, its a great way to simplify the implementation of your standard RESTful controller.  My controllers became way more DRY as a result.  Again, saw James at dinner and shook his hand in person but it doesn&#8217;t hurt to say it here.</p></li>
</ol>

<p><span style="text-decoration: underline;">Honorary Mentions:</span></p>

<ul>
    <li>DHH and RailsCore for Rails (DUH)</li>
    <li>Chad Fowler and company for organizing RailsConf</li>
    <li>Gregg Pollack for the Ruby Heroes presentation, conference videos and the entertaining RailsEnvy podcasts (along with Jason Seifer.)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/05/a-public-thank-you/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/05/a-public-thank-you/</feedburner:origLink></item>
		<item>
		<title>RailsConf Kicks Off</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/ibPCEnFPSr4/</link>
		<comments>http://railsdog.com/blog/2009/05/railsconf-kicks-off/#comments</comments>
		<pubDate>Wed, 06 May 2009 05:28:35 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[RailsConf]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=50</guid>
		<description><![CDATA[Well today was the first day of talks here at RailsConf.  DHH kicked things off with an opening speech.  He spent some time talking about Rails 3.0 features but unfortunately it was hard to follow the slides in the back.  Somebody on #railsconf thought it would be cool if you could broadcast slides to everyoene&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Well today was the first day of talks here at RailsConf.  DHH kicked things off with an opening speech.  He spent some time talking about Rails 3.0 features but unfortunately it was hard to follow the slides in the back.  Somebody on #railsconf thought it would be cool if you could broadcast slides to everyoene&#8217;s laptop during the live talk.  That would have come in handy for this.</p>

<p>The talk was good despite the sound and slide difficulties.  I always enjoy hearing how other programmers approach the challenges of their job.  DHH was talking about how &#8220;renogiation of requirements&#8221; can ultimately lead to a huge productivity gain.  He described a time at 37 signals where he spent two weeks trying to solve an impossible task.  He ultimately came up with a much simpler solution and proposed it to the client.  Client was indifferent (&#8221;Sure, whatever&#8221;) and he was done in 48 hours.</p>

<p>The talks this morning have been pretty good so far.  Mercifully there is no smoking in the conference center so that is a welcome change of pace from the rest of the hotel.  My main complaint so far would be that the chairs have metal backs with no cushion so they&#8217;re extremely uncomfortable.</p>

<p>One last thing I would like to mention is the state of the Rails community.  There are lots of first time RailsConf attendees here this year which is a great sign.  People also seem to be mixing a lot better instead of hanging out exclusively with the people that they came here with.  The Rails community really seems to be moving in a more positive direction, despite minor flare ups and distractions along the way.</p>

<p>I really think the whole Rails - Merb merger sets a good example for how much everyone stands to gain when setting aside ego and just work together to write the best possible software.  Constructive criticism is fine but collaboration is even more productive.</p>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/05/railsconf-kicks-off/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/05/railsconf-kicks-off/</feedburner:origLink></item>
		<item>
		<title>Vegas: First Impressions</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/bzfmIle-GHU/</link>
		<comments>http://railsdog.com/blog/2009/05/vegas-first-impressions/#comments</comments>
		<pubDate>Tue, 05 May 2009 21:20:06 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[RailsConf]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=46</guid>
		<description><![CDATA[I&#8217;ve been in dozens of airports around the world but stepping off the plane at LAS conveys the immediate impression that you have arrived somewhere different.  The first thing you see as you come out of the jetway are tons of slot machines.  I have nothing nice to say about the airport ground transportation options.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been in dozens of airports around the world but stepping off the plane at LAS conveys the immediate impression that you have arrived somewhere different.  The first thing you see as you come out of the jetway are tons of slot machines.  I have nothing nice to say about the airport ground transportation options.  I used the 30 minute ride to my hotel (which was like 5 miles from the airport) to come up with about half a dozen ways to design a better system.  You can start by knocking down the worthless fucking monorail that they have and replace it with a proper light rail system that would actually connect people to the one place everyone wants to go - the airport!</p>

<p>Went out last night with <a href="http://twitter.com/hackerchic">@hackerchic</a>, <a href="http://twitter.com/tunagami">@tunagami</a> and Sonny (twitter account not shown.)  Took the afore mentioned monorail to the MGM where we had a good time at the Centrifuge bar.  Every 20 minutes or so some dance song would come blasting on and the bar tenders would all jump up on the bar and start dancing.  So that seemed to be a pretty authentic Vegas experience.</p>

<p>Cigarette smoking is completely out of hand here.  I&#8217;m really not used to people smoking indoors and it seems to be everywhere.  My eyes and throat are really irritated from all of the second hand smoke.  On the plus side, you can drink beer anywhere you want (including in the middle of the street.)  Its kind of strange to be drinking a beer while in line to check in to your hotel (next to the guy smoking a cigarette.)  Even stranger is the notion of just walking outside with a giant 32 oz. beer in your hand.</p>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/05/vegas-first-impressions/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/05/vegas-first-impressions/</feedburner:origLink></item>
		<item>
		<title>Five Reasons To Go to RailsConf</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/0zGkQxtv3eg/</link>
		<comments>http://railsdog.com/blog/2009/04/five-reasons-to-go-to-railsconf/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 02:03:17 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[RailsConf]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=38</guid>
		<description><![CDATA[RailsConf is less than three weeks away now but there is still time to sign up if you&#8217;re interested in coming. With the recent reduction in the hotel price ($99) it might be worth considering. Here are a few more reasons to go this year in no particular order:


     Excellent Speakers [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.oreilly.com/rails2009/">RailsConf</a> is less than three weeks away now but there is still time to sign up if you&#8217;re interested in coming. With the recent reduction in the hotel price ($99) it might be worth considering. Here are a few more reasons to go this year in no particular order:</p>

<ol>
    <li> Excellent Speakers &#8212; Last year was my first RailsConf and I was blown away by the quality of the speakers. Pretty much every single session had both an interesting topic and an engaging speaker. Some sessions are better than others, but overall I think the speaker quality was quite high. The slides are always available online and usually very high-quality.</li>
    <li> Convenient Location &#8212; This year the conference will be held in Las Vegas, Nevada for the first time. Las Vegas is easy to get to from almost anywhere in the United States. There really isn&#8217;t a better location in terms of the sheer number of direct flights other than perhaps Orlando Florida. The conference will also be held in the actual hotel where attendees will be staying. With an action-packed schedule this really adds to the convenience since you won&#8217;t be traveling back and forth from the hotel to the conference center like last year. It&#8217;s all right there under one roof.</li>
    <li>Hiring Opportunities &#8212; At last year&#8217;s RailsConf there was a shocking number of companies who were interested in hiring qualified Rails programmers. Every time I sat down there was some brochure or business card laying there mentioning that such and such a company was looking to hire. So if you&#8217;re looking to switch jobs or to find out more about the kinds of jobs that are out there this is a great opportunity.</li>
    <li>Creativity Boost &#8212; RailsConf is also a great opportunity to come up with new ideas and inspiration for your next 12 months of programming. With all the great talks and ideas floating around your head will soon be buzzing with exciting new ideas to take back to your existing job. It&#8217;s a great opportunity to take a break from the daily coding march and to gain some new perspective.</li>
    <li>A Chance to Network &#8212; The conference is also a chance to meet all those people you have been chatting with online over these past several months. All of your favorite bloggers will be there plus those people whom you&#8217;ve been working with on your favorite open source projects. It&#8217;s fun to put a name with a face and have more in-depth discussions that are not really possible online.</li>
</ol>

<p>So if you haven&#8217;t already signed up for RailsConf go and do it now. It&#8217;s definitely worth the time and money.  If you decide to go, make sure to say &#8220;hi&#8221; if you see me there.</p>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/04/five-reasons-to-go-to-railsconf/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/04/five-reasons-to-go-to-railsconf/</feedburner:origLink></item>
		<item>
		<title>Custom Bash Prompt for Git Branches</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/arRP0Vifc7E/</link>
		<comments>http://railsdog.com/blog/2009/03/custom-bash-prompt-for-git-branches/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 16:04:00 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[git bash]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=4</guid>
		<description><![CDATA[If you are an active git user then you may find yourself constantly switching between different branches in the same project as you are working.  If you&#8217;re not doing this, you&#8217;re probably not experiencing the full power of git.  I recently added some functionality to my bash prompt that shows the current git [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_36" class="wp-caption alignleft" style="width: 138px"><img class="size-full wp-image-36" title="git-bash" src="http://railsdog.com/blog/wp-content/uploads/2009/03/git-bash.png" alt="example of git bash prompt" width="128" height="31" /><p class="wp-caption-text">git bash prompt</p></div></p>

<p>If you are an active <a href="http://git.or.cz">git</a> user then you may find yourself constantly switching between different branches in the same project as you are working.  If you&#8217;re not doing this, you&#8217;re probably not experiencing the full power of git.  I recently added some functionality to my bash prompt that shows the current git branch in green and a yellow asterisk if there are uncommitted changes in the project.</p>

<p>Here&#8217;s how to do it.  First you will need a copy of <a href="http://gist.github.com/75436"><code>.git<em>completion.sh</code></a> in your home directory.  This script has some functions that we will use to customize the bash prompt.  It also has some nice side effects like tab completion for branch names, etc.  Now simply add the following to your <code>.bash</em>profile</code></p>

<pre><code>
source ~/.git_completion.sh

function parse_git_dirty {
  [[ $(git status 2&gt; /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] &amp;&amp; echo "*"
}

function parse_git_branch {
  git branch --no-color 2&gt; /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}

export PS1='\h:\W$(__git_ps1 "[\[\e[0;32m\]%s\[\e[0m\]\[\e[0;33m\]$(parse_git_dirty)\[\e[0m\]]")$ '
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/03/custom-bash-prompt-for-git-branches/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/03/custom-bash-prompt-for-git-branches/</feedburner:origLink></item>
		<item>
		<title>GitHub Search Tip</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/JJslzK2kSic/</link>
		<comments>http://railsdog.com/blog/2009/02/github-search-tip/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 12:58:26 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[git github]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=5</guid>
		<description><![CDATA[GitHub recently made significant changes to their search functionality.  I often use their search to look for related projects, such as new Spree extensions.  Prior to these changes I would simply search on spree.  Now when you do this the default results are IMO less then desirable. 

So if you&#8217;re like me [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com">GitHub</a> recently made significant changes to their search functionality.  I often use their search to look for related projects, such as new <a href="http://spreehq.org">Spree</a> extensions.  Prior to these changes I would simply search on <code>spree</code>.  Now when you do this the default results are IMO less then desirable. </p>

<p>So if you&#8217;re like me and you just want to find projects containing your search term then I have a tip for you.  Just add <code>fork:false</code> to your search and it will exclude all of the forks from your results.  This makes it much eeasier for projects like Spree where there are 60+ forks that you would have to sift through in order to find what you&#8217;re really looking for.</p>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2009/02/github-search-tip/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2009/02/github-search-tip/</feedburner:origLink></item>
		<item>
		<title>Rails Commerce App in Ten Minutes</title>
		<link>http://feedproxy.google.com/~r/railsdog/~3/QnqgDizQTLg/</link>
		<comments>http://railsdog.com/blog/2008/11/rails-commerce-app-in-ten-minutes/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 17:28:54 +0000</pubDate>
		<dc:creator>railsdog</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://railsdog.com/?p=7</guid>
		<description><![CDATA[In today&#8217;s blog post, I show you how to get a Ruby on Rails based commerce app up and running in ten minutes.  We&#8217;ll be using the Heroku (think Rails cloud) as the hosting service and Spree as the commerce platform.  

Prerequisites 

The &#8220;10 minute&#8221; claim assumes you already have a Heroku account [...]]]></description>
			<content:encoded><![CDATA[<p>In today&#8217;s blog post, I show you how to get a Ruby on Rails based commerce app up and running in ten minutes.  We&#8217;ll be using the <a href="http://heroku.com">Heroku</a> (think Rails cloud) as the hosting service and <a href="http://spreehq.org">Spree</a> as the commerce platform.  </p>

<p><strong>Prerequisites</strong> </p>

<p>The &#8220;10 minute&#8221; claim assumes you already have a Heroku account and that you have , <a href="http://ruby-lang.org">Ruby</a>, <a href="http://rubyonrails.org">Rails 2.1.2</a> and <a href="http://www.rubygems.org">Gems</a> installed locally.</p>

<p>You will also need to have <a href="http://git.or.cz">git</a> installed and a public ssh key.  If you&#8217;ve been doing Rails development on a Mac or other Unix type system this shouldn&#8217;t be new to you.  If for some strange reason you haven&#8217;t started using git yet, you need to do yourself a favor and look into it.</p>

<p><strong>Step 1. Grab the <code>heroku</code> and <code>spree</code> gems.</strong></p>

<pre><code>
sudo gem install heroku
sudo gem install spree
</code></pre>

<p><strong>Step 2. Create the store</strong></p>

<p>Use the Spree gem to create the store locally</p>

<pre><code>
spree footore
</code></pre>

<p><em>You will need to pick a unique name for your store for heroku so don&#8217;t call it foostore since that is already taken.</em></p>

<p><strong>Step 3. Place your store under git source control</strong></p>

<p>Heroku uses git to manage its deployment.  So put your new Spree app under source control.</p>

<pre><code>
cd footore
git init
git add .
git commit -m "First commit."
</code></pre>

<p><strong>Step 4. Unpack Gems</strong></p>

<p>Heroku doesn&#8217;t seem to want to use its own gem repository.  No worries, just unpack the gems that Spree requires using</p>

<pre><code>
rake gems:unpack
git add vendor/gems
git commit -m "Unpacked gems."
</code></pre>

<p>Spree itself also needs to be unpacked</p>

<pre><code>
rake spree:freeze:gems
git add vendor/spree
git commit -m "Froze Spree 0.5.0"
</code></pre>

<p><strong>Step 5. Tweak the Rails Version</strong></p>

<p>Unfortunately Heroku only supports certain Rails versions and they tend to lag behind the latest.  Spree requires Rails 2.1.2 but Heroku only works with Rails 2.1.  So we just need to modify Spree to work with Rails 2.1 instead.</p>

<p>Edit <code>config/boot.rb</code> and replace</p>

<pre><code>load_rails("2.1.2")</code></pre>

<p>with</p>

<pre><code>load_rails("2.1")</code></pre>

<p>Now commit these changes</p>

<pre><code>
git add config/boot.rb
git commit -m "Switch to Rails 2.1
</code></pre>

<p><strong>Step 6. Add the store to Heroku</strong></p>

<pre><code>
heroku create foostore
</code></pre>

<p>The first time you add an app into Heroku it will ask you for the email address and password associated with your Heroku account.  Interestingly, the heroku gem also copies your public ssh key up to heroku so that you can authenticate with your private key going forward.</p>

<p>Remember to choose a unique name for your store since apparently Heroku requires all applications to have a unique name (otherwise it will warn you that the name is already taken.)</p>

<p><strong>Step 7. Push to Heroku</strong></p>

<pre><code>
git remote add heroku git@heroku.com:foostore.git
git push -f heroku
</code></pre>

<p>Through the magic of Heroku, your application is now deployed!  It takes a while to run the migrations but you should get there eventually.</p>

<p>The <code>git remote add</code> and <code>-f</code> stuff is a onetime deal.  Going forward you can update with just <code>git push</code>.</p>

<p><strong>Step 8. Make the store public</strong></p>

<p>The store is now technically deployed on Heroku but its not yet publicly visible.  Using your browser you need to log into your Heroku account.</p>

<p>Click the &#8220;settings&#8221; link and the select the radio button to make it public as well as the radio button at the bottom to run in the much faster &#8220;production&#8221; mode.  Heroku has some interesting abilities to edit online but I&#8217;m a big fan of local development on Textmate so I have no use for the development mode.</p>

<p>That&#8217;s it.  You can now hit your webapp at http://foostore.heroku.com.  Be sure to login (username: <code>admin</code> password: <code>spree</code>) and change the default password to something more secure.</p>

<p>There are several intersting aspects of Heroku which I&#8217;ll save for another blog post.  One interesting thing I&#8217;ll mention here is the ability to run rake commands on the remote server in your local shell.</p>

<p><strong>Conclusion</strong></p>

<p>Well now you have your online store up and it only took you ten minutes (or so.)  Time to show it to your prospective client and lock down that contract!  Best part is that this cost you nothing (at least for now while Heroku is still free.)</p>
]]></content:encoded>
			<wfw:commentRss>http://railsdog.com/blog/2008/11/rails-commerce-app-in-ten-minutes/feed/</wfw:commentRss>
		<feedburner:origLink>http://railsdog.com/blog/2008/11/rails-commerce-app-in-ten-minutes/</feedburner:origLink></item>
	</channel>
</rss>
