<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>has_many :thoughts: Skinny Controller, Fat Model</title>
    <link>http://blog.kineticweb.com/articles/2007/06/01/skinny-controller-fat-model</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Musings from a Ruby on Rails development team</description>
    <item>
      <title>Skinny Controller, Fat Model</title>
      <description>&lt;p&gt;One of my favorite talks from RailsConf was by the team behind &lt;a href="http://www.therailsway.com"&gt;The Rails Way&lt;/a&gt;. Now back from the road trip and settled in, they have updated their site with some more details about one of the ideas they pushed: Controllers should be simple, basic, and generally have a lot less code then most of us use now. Most of your logic should end up in the model.&lt;/p&gt;


There&amp;#8217;s many reasons for this but the three I like the most:
	&lt;ol&gt;
	&lt;li&gt;It forces you to write code that more easily reused. Limits your temptation to copy/paste from one controller action to another.&lt;/li&gt;
		&lt;li&gt;Your templates can become more details. @order.total instead of @total (which would have to be mapped to something logic in the controller.)&lt;/li&gt;
		&lt;li&gt;The code is more easily tested. You can programmatically   access the results of the methods in your model without having to munge &lt;span class="caps"&gt;HTML&lt;/span&gt; output from a controller.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;&lt;a href="http://www.therailsway.com/2007/6/1/railsconf-recap-skinny-controllers"&gt;Their post&lt;/a&gt; has all the details and code samples.&lt;/p&gt;</description>
      <pubDate>Fri, 01 Jun 2007 21:07:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:f3c58e79-0490-4bc0-ab0a-7fbcd88131ff</guid>
      <author>Colin A. Bartlett</author>
      <link>http://blog.kineticweb.com/articles/2007/06/01/skinny-controller-fat-model</link>
      <category>Rails</category>
      <category>TDD</category>
      <category>RailsConf</category>
      <category>RailsConf07</category>
      <trackback:ping>http://blog.kineticweb.com/articles/trackback/36</trackback:ping>
    </item>
  </channel>
</rss>
