<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" version="2.0">
  <channel>
    <title>Recent Posts in Ruby | State College Ruby Group</title>
    <link>http://statecollegeruby.org/forums/2/posts</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <atom:link href="http://statecollegeruby.org/open_search.xml" rel="search" type="application/opensearchdescription+xml"/>
    <item>
      <title>free RoR book download: build your own RoR app replied by friarminor @ Fri, 25 Apr 2008 07:16:03 -0000</title>
      <description>&lt;p&gt;Andrew,&lt;/p&gt;


	&lt;p&gt;You may also visit Satish&amp;#8217;s rubylearning.com for free online course on ruby.  He also points you to other learning materials that will surely help any newbie rubyist.&lt;/p&gt;


	&lt;p&gt;Best.&lt;br /&gt;alain&lt;/p&gt;</description>
      <pubDate>Fri, 25 Apr 2008 07:16:03 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:22:91</guid>
      <author>friarminor</author>
      <link>http://statecollegeruby.org/forums/2/topics/22</link>
    </item>
    <item>
      <title>Keeping up with the best Ruby blogs replied by friarminor @ Fri, 25 Apr 2008 07:10:26 -0000</title>
      <description>&lt;p&gt;Hello!&lt;/p&gt;


	&lt;p&gt;I have been spending quite some time now searching the ruby universe and I&amp;#8217;d like to share these new ones I just found out;&lt;br /&gt;&lt;a href="http://rubyflow.com"&gt;http://rubyflow.com&lt;/a&gt; and &lt;a href="http://whatsupinruby.com"&gt;http://whatsupinruby.com&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Best.&lt;br /&gt;alain&lt;/p&gt;</description>
      <pubDate>Fri, 25 Apr 2008 07:10:26 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:4:90</guid>
      <author>friarminor</author>
      <link>http://statecollegeruby.org/forums/2/topics/4</link>
    </item>
    <item>
      <title>Ruby class methods replied by woods @ Fri, 15 Feb 2008 14:08:54 -0000</title>
      <description>&lt;p&gt;I was experimenting with Ruby class methods this morning, and wound up with a fairly lengthy demonstration script. What do you think? Did I miss anything or get anything wrong? Anything you don&amp;#8217;t understand?&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://blog.westarete.com/2008/02/15/exploring-ruby-class-methods/"&gt;http://blog.westarete.com/2008/02/15/exploring-...&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 15 Feb 2008 14:08:54 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:33:89</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/33</link>
    </item>
    <item>
      <title>Rails' Architecture replied by Andrew @ Thu, 14 Feb 2008 03:30:28 -0000</title>
      <description>&lt;p&gt;At this meetup, Scott and I started talking about really understanding Rails&amp;#8217; architecture, from a conceptual point of view. After a bit of searching, I came up with this blog post on Rails&amp;#8217; architecture: &lt;a href="http://cfis.savagexi.com/articles/2007/09/05/rails-unusual-architecture"&gt;http://cfis.savagexi.com/articles/2007/09/05/ra&amp;#8230;&lt;/a&gt;. Unfortunately, this post talks a lot about design patterns, etc. that don&amp;#8217;t make a lot of sense to me. Does anyone have a more&amp;#8230; primitive explanation of what all this means?&lt;/p&gt;</description>
      <pubDate>Thu, 14 Feb 2008 03:30:28 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:32:88</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/32</link>
    </item>
    <item>
      <title>Heroku.com replied by Busterdog @ Sat, 09 Feb 2008 22:45:38 -0000</title>
      <description>&lt;p&gt;I would like an invite. I registered, but it is taking a while.&lt;/p&gt;</description>
      <pubDate>Sat, 09 Feb 2008 22:45:38 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:27:87</guid>
      <author>Busterdog</author>
      <link>http://statecollegeruby.org/forums/2/topics/27</link>
    </item>
    <item>
      <title>Idea for a RoR plugin replied by Andrew @ Wed, 30 Jan 2008 03:36:54 -0000</title>
      <description>&lt;p&gt;The RoR plugin that would let you write your css files in ruby (erb, ie style.css.erb) which would compile to css. That way, you could write perfectly standard css code, and it would output several css files that are quirks compliant.You could make several stylesheets like layout.css.erb and tabs.css.erb and so on&amp;#8230; and once you&amp;#8217;ve out your app in production, it would flatten all of them into one file, and minify it.&lt;/p&gt;</description>
      <pubDate>Wed, 30 Jan 2008 03:36:54 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:31:86</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/31</link>
    </item>
    <item>
      <title>Another blog, and a great tutorial on REST concepts replied by Andrew @ Tue, 29 Jan 2008 08:12:19 -0000</title>
      <description>&lt;p&gt;An idea just struck me: I think with all the RESTfulness, rails might be evolving from an &lt;span class="caps"&gt;MVC&lt;/span&gt; to an RV (resource-view) framework. What do you think?&lt;/p&gt;</description>
      <pubDate>Tue, 29 Jan 2008 08:12:19 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:5:85</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/5</link>
    </item>
    <item>
      <title>Keeping up with the best Ruby blogs replied by Andrew @ Sun, 27 Jan 2008 03:53:51 -0000</title>
      <description>&lt;p&gt;Recently, a subreddit was created specifically for ruby: &lt;a href="http://ruby.reddit.com"&gt;http://ruby.reddit.com&lt;/a&gt; . It should be a good source of information.&lt;/p&gt;</description>
      <pubDate>Sun, 27 Jan 2008 03:53:51 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:4:84</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/4</link>
    </item>
    <item>
      <title>Another blog, and a great tutorial on REST concepts replied by Andrew @ Tue, 01 Jan 2008 20:26:16 -0000</title>
      <description>&lt;p&gt;In trying to wrap my head around rest concepts, I came up with the following table that sort everything nicely (for me, anyway):&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://docs.google.com/View?docid=dgn2nsft_27c293hdgn"&gt;http://docs.google.com/View?docid=dgn2nsft_27c2&amp;#8230;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Does this make sense? Is there a better way to describe and categorize these things? Disclaimer: I plan on buying the O&amp;#8217;Reilly &lt;strong&gt;RESTful Web Services&lt;/strong&gt; book; maybe there&amp;#8217;s a much better way to think about &lt;span class="caps"&gt;REST&lt;/span&gt; in the book.&lt;/p&gt;</description>
      <pubDate>Tue, 01 Jan 2008 20:26:16 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:5:83</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/5</link>
    </item>
    <item>
      <title>Heroku.com replied by gr8bluesgtr @ Wed, 12 Dec 2007 15:26:06 -0000</title>
      <description>&lt;p&gt;That. Is. Awesome.&lt;/p&gt;


	&lt;p&gt;This is scary.  Just the other day I was thinking to myself &amp;#8220;Wouldn&amp;#8217;t it be great if someone would think up a way to a &lt;span class="caps"&gt;CMS&lt;/span&gt; like ruby on rails application, where you create, develop and edit your application online instead of on your own desktop.  And here it is.  Wow.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Dec 2007 15:26:06 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:27:82</guid>
      <author>gr8bluesgtr</author>
      <link>http://statecollegeruby.org/forums/2/topics/27</link>
    </item>
    <item>
      <title>Using Microsoft Access MDB files from Ruby replied by woods @ Fri, 30 Nov 2007 13:59:28 -0000</title>
      <description>&lt;p&gt;Here&amp;#8217;s a small Ruby script that I used to open and modify a Microsoft Access database file:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://pastie.caboo.se/123692"&gt;http://pastie.caboo.se/123692&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I wrote it to hack around a limitation with Adobe Photoshop Elements 3.0 where it can&amp;#8217;t move your entire photo library to a different location properly. I found out that they use the Microsoft Access database file format, and decided to use Ruby to modify all the paths in the database to point to the new location (I opened the file in Access first to figure out the structure and table and field names).&lt;/p&gt;


	&lt;p&gt;The script doesn&amp;#8217;t use any non-standard gems. However, it does need to run on Windows, since it relies on Microsoft&amp;#8217;s Jet engine library (the engine that drives access to &lt;span class="caps"&gt;MDB&lt;/span&gt; files) via the &amp;#8220;win32ole&amp;#8221; gem that comes with Windows Ruby distributions.&lt;/p&gt;


	&lt;p&gt;For reference, I did get it working with ActiveRecord via a whole other set of gems, but it&amp;#8217;s not really worth the effort for a small project like this since one of the gems is problematic to build on Windows. Instead, I&amp;#8217;m posting this simple version here. No ActiveRecord elegance, but no time spent on setup either.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m posting it here in case anyone finds it useful. I think it&amp;#8217;s also a nice demonstration of Ruby&amp;#8217;s versatility.&lt;/p&gt;</description>
      <pubDate>Fri, 30 Nov 2007 13:59:28 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:28:77</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/28</link>
    </item>
    <item>
      <title>Heroku.com replied by Andrew @ Mon, 26 Nov 2007 01:21:50 -0000</title>
      <description>&lt;p&gt;I just got an invitation to &lt;a href="http://heroku.com"&gt;heroku&lt;/a&gt; (an instant rails hosting/online editing app). I was thinking we could try using it during ruby meetings, since anything you create/change is instantly live. Let me know if anyone needs an invite (invitees skip the waiting list).&lt;/p&gt;</description>
      <pubDate>Mon, 26 Nov 2007 01:21:50 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:27:76</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/27</link>
    </item>
    <item>
      <title>Good RoR plugins replied by Andrew @ Wed, 21 Nov 2007 19:54:39 -0000</title>
      <description>&lt;p&gt;Regarding jq4r,there&amp;#8217;s another one called &lt;a href="http://ennerchi.com/projects/jrails#install"&gt;jRails&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 21 Nov 2007 19:54:39 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:24:75</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/24</link>
    </item>
    <item>
      <title>Links for SQL Tree Extensions, Mercurial VCS replied by woods @ Thu, 15 Nov 2007 13:18:44 -0000</title>
      <description>&lt;p&gt;Cool, thanks for the links, Russ.&lt;/p&gt;


	&lt;p&gt;For everyone who wasn&amp;#8217;t at the meetup last night, Russ recommended Mercurial as one of the better version control systems (VCS) for people who haven&amp;#8217;t used a &lt;span class="caps"&gt;VCS&lt;/span&gt; before. Easy to use and understand, and doesn&amp;#8217;t require a server at first&amp;#8212;you can just download and start using it.&lt;/p&gt;


	&lt;p&gt;We got on the tree vs. nested set vs. &amp;#8220;connect by&amp;#8221; topic when Tony was talking about using nested sets vs. conventional trees in your database.  Conventional trees (using a parent_id column that points back into the same table) are the obvious method for representing a hierarchy in a database, but the &lt;span class="caps"&gt;SQL&lt;/span&gt; language doesn&amp;#8217;t provide any elegant way to traverse such a structure or select cohesive subsets of the tree. Nested sets are a functionally equivalent way of representing the data, and while they&amp;#8217;re not as obvious or easy for humans to grasp, they match &lt;span class="caps"&gt;SQL&lt;/span&gt;&amp;#8217;s capabilities well and allow for the types of queries that you&amp;#8217;d commonly like to do on trees. &lt;a href="http://statecollegeruby.org/forums/1/topics/25#post_72"&gt;Here&amp;#8217;s Tony&amp;#8217;s follow up in another thread&lt;/a&gt; which includes a link to a comparison of the two techniques.&lt;/p&gt;


	&lt;p&gt;Russ brought up the fact the Oracle (and PostgreSQL with a recompile) have an extension to the &lt;span class="caps"&gt;SQL&lt;/span&gt; language that provides the best of both worlds; you can structure your trees the &amp;#8220;obvious&amp;#8221; conventional way, and the language extension provides an easy and efficient way to then work with the trees.&lt;/p&gt;</description>
      <pubDate>Thu, 15 Nov 2007 13:18:44 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:26:74</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/26</link>
    </item>
    <item>
      <title>Links for SQL Tree Extensions, Mercurial VCS replied by russ @ Thu, 15 Nov 2007 03:33:20 -0000</title>
      <description>&lt;p&gt;Here&amp;#8217;s a nice page that explains the Oracle &amp;#8220;CONNECT BY&amp;#8221; &lt;span class="caps"&gt;SQL&lt;/span&gt; extension, which lets you work with trees easily and efficiently:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;&lt;a href="http://philip.greenspun.com/sql/trees.html"&gt;http://philip.greenspun.com/sql/trees.html&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Postgres has a connectby() function which does something similar, but unfortunately it isn&amp;#8217;t built by default (it&amp;#8217;s in the contrib/ folder in the Postgres sources).&lt;/p&gt;


	&lt;p&gt;Here are some links for the Mercurial version control system: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;Homepage           &lt;a href="http://www.selenic.com/mercurial/wiki/"&gt;http://www.selenic.com/mercurial/wiki/&lt;/a&gt;
Book               &lt;a href="http://hgbook.red-bean.com/"&gt;http://hgbook.red-bean.com/&lt;/a&gt;
Windows GUI        &lt;a href="http://tortoisehg.sourceforge.net/"&gt;http://tortoisehg.sourceforge.net/&lt;/a&gt;
Subversion client  &lt;a href="http://cheeseshop.python.org/pypi/hgsvn/"&gt;http://cheeseshop.python.org/pypi/hgsvn/&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;The first couple of chapters of the Mercurial book are an excellent read if you have time to go through them. There are also shorter tutorials on the Mercurial home page.&lt;/p&gt;


	&lt;p&gt;Part of what I said about the Mercurial Subversion client turned out not to be true. It can only &amp;#8220;pull&amp;#8221; changes from a remote Subversion repository, not &amp;#8220;push&amp;#8221; them back. To get changes back to the Subversion repository, you currently have to check them in with the normal svn client.&lt;/p&gt;


	&lt;p&gt;- Russ&lt;/p&gt;</description>
      <pubDate>Thu, 15 Nov 2007 03:33:20 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:26:71</guid>
      <author>russ</author>
      <link>http://statecollegeruby.org/forums/2/topics/26</link>
    </item>
    <item>
      <title>Good RoR plugins replied by Andrew @ Wed, 14 Nov 2007 19:43:09 -0000</title>
      <description>&lt;p&gt;Just read about the make_resourceful plugin; seems like it would be really useful for RESTful development. One gotcha is that it requires haml.&lt;/p&gt;</description>
      <pubDate>Wed, 14 Nov 2007 19:43:09 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:24:69</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/24</link>
    </item>
    <item>
      <title>Good RoR plugins replied by woods @ Wed, 07 Nov 2007 15:50:03 -0000</title>
      <description>&lt;p&gt;One more!&lt;/p&gt;


	&lt;p&gt;I know that someone mentioned jQuery as a good javascript library; an alternative to Prototype and Scriptaculous. I will definitely be checking jQuery out, since its syntax seems a little easier and more sensible.&lt;/p&gt;


	&lt;p&gt;One of the big downsides though is that Prototype and Scriptaculous are already tightly integrated into Rails with all sorts of helpful helpers. It turns out there&amp;#8217;s a jq4r plugin that is starting to produce the same helpers for jQuery. Here&amp;#8217;s the blog:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://jq4r.blogspot.com/"&gt;http://jq4r.blogspot.com/&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 07 Nov 2007 15:50:03 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:24:65</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/24</link>
    </item>
    <item>
      <title>Good RoR plugins replied by woods @ Wed, 07 Nov 2007 15:19:31 -0000</title>
      <description>&lt;p&gt;Here&amp;#8217;s another interesting plugin for creating custom find queries on your ActiveRecord models. This seems very concise, and would probably make for much more readable code in the end, even if your queries aren&amp;#8217;t complex. I&amp;#8217;m a big fan of creating custom methods for find queries, since something like &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;Post.find_recent&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;is more clear than &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;Post.find(:all, :order =&amp;gt; "created_at DESC", :limit =&amp;gt; 10)&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;I further like his convention of dropping the leading &amp;#8220;find_&amp;#8221; from the method name, so that &amp;#8220;Post.find_recent&amp;#8221; just becomes &amp;#8220;Post.recent&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.pivotalblabs.com/articles/2007/09/02/hasfinder-its-now-easier-than-ever-to-create-complex-re-usable-sql-queries"&gt;http://www.pivotalblabs.com/articles/2007/09/02&amp;#8230;&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 07 Nov 2007 15:19:31 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:24:64</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/24</link>
    </item>
    <item>
      <title>Good RoR plugins replied by woods @ Wed, 07 Nov 2007 00:24:11 -0000</title>
      <description>&lt;p&gt;Going along with the versioning stuff, we&amp;#8217;ve used acts_as_paranoid a good bit before, and while it has a couple obscure limitations, it works fine. Basically, this is a plugin that provides &amp;#8220;undelete&amp;#8221; support. It simply marks your records as deleted rather than actually deleting them from the table, and then overrides the &amp;#8220;find&amp;#8221; method to return only undeleted items by default.&lt;/p&gt;


	&lt;p&gt;This plugin is also an excellent read. I highly recommend reading and understanding both acts_as_paranoid and acts_as_versioned, whether you&amp;#8217;re going to use them or not. They&amp;#8217;re great structural templates for creating your own plugins and the code, while sparse on comments and documentation, is very well written. You&amp;#8217;ll learn a lot about changing ActiveRecord&amp;#8217;s default behavior and about metaprogramming.&lt;/p&gt;


	&lt;p&gt;Both plugins would be much easier to understand if they weren&amp;#8217;t so configurable&amp;#8212;the column names that they use are flexible, which makes the code less readable.&lt;/p&gt;


	&lt;p&gt;For the record, I believe that both plugins are written by Rick Olsen, who&amp;#8217;s now the core member that&amp;#8217;s responsible for much of ActiveRecord itself.&lt;/p&gt;</description>
      <pubDate>Wed, 07 Nov 2007 00:24:11 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:24:63</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/24</link>
    </item>
    <item>
      <title>Good RoR plugins replied by woods @ Wed, 07 Nov 2007 00:17:39 -0000</title>
      <description>&lt;p&gt;Regarding acts_as_versioned, the plugin for revision history, I&amp;#8217;ve pulled it apart from top to bottom before and used it a good bit.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s fairly simplistic, and has its limitations. As such, I&amp;#8217;d suggest reading it all and understanding it pretty thoroughly to make sure it does what you want and to make sure you understand the limitations. Also, there&amp;#8217;s not any documentation for it, so you pretty much have to read the code to get full value out of it!&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s a brief explanation of how it works: Let&amp;#8217;s say you have a table called &amp;#8220;customers&amp;#8221; that you want to version. You declare it to be &amp;#8220;acts_as_versioned&amp;#8221; in the model, and create a nearly-identical table called &amp;#8220;customers_versions&amp;#8221; in the database. The &amp;#8220;customers&amp;#8221; table will hold the current version of the data (as usual), and the &amp;#8220;customers_versions&amp;#8221; table now holds all of the old copies of the &amp;#8220;customers&amp;#8221; records.&lt;/p&gt;


	&lt;p&gt;Now each time you save a customer, the plugin will save a copy of the old record in the &amp;#8220;customers_versions&amp;#8221; table and increment the version number on the current table. Since the &amp;#8220;customers&amp;#8221; table is virtually identical to the one that you&amp;#8217;d have if you weren&amp;#8217;t using acts_as_versioned (it just has an extra column to tell you the current version for each record), ActiveRecord and anything else can use that current version and ignore the fact that this is a &amp;#8220;versioned&amp;#8221; table.&lt;/p&gt;


	&lt;p&gt;If you want to go get a previous version of the customer, the plugin simply looks in the &amp;#8220;customers_versions&amp;#8221; table for the same record that has the previous version number. It then generates a new instance of the model with that data and hands it back to you. If you save it, you&amp;#8217;ll save a new version and essentially revert back to the old data that you requested.&lt;/p&gt;


	&lt;p&gt;That&amp;#8217;s basically it. There are a couple other nice methods to help you traverse the history for a record and do some simple manipulations. It&amp;#8217;s a pretty simple plugin, as versioning goes.&lt;/p&gt;


	&lt;p&gt;So what are the limitations? The plugin just saves a copy of all the record&amp;#8217;s attributes into its history, without any regard for what those attributes mean. This works fine if you&amp;#8217;re dealing with attributes that don&amp;#8217;t have any special meaning to rails, like &amp;#8220;first_name&amp;#8221;, &amp;#8220;title&amp;#8221;, or &amp;#8220;body&amp;#8221;. However, it doesn&amp;#8217;t work well at all for things like &amp;#8220;contact_id&amp;#8221;, or &amp;#8220;position&amp;#8221;. The reason is that those attributes refer to other records; records that might have changed since the last version was saved. If the old record is resurrected, and contact_id is no longer valid, or if the position of the neighboring records has changed (&amp;#8220;position&amp;#8221; is used by acts_as_list), then your referential integrity is going to be broken. You&amp;#8217;ll call &amp;#8220;customer.contact&amp;#8221;, and you&amp;#8217;ll get an exception since the old contact_id can no longer be found in the current database.&lt;/p&gt;


	&lt;p&gt;Versioning relational data is really hard. I&amp;#8217;ve read big fat books on it (I can dig up the title if you really want it), and I have to say that it&amp;#8217;s not worth implementing yourself unless it&amp;#8217;s the point of the entire exercise&amp;#8212;it shouldn&amp;#8217;t just be a feature in your application.&lt;/p&gt;


	&lt;p&gt;So basically, if you&amp;#8217;re using it to version unrelated data like wiki pages, you&amp;#8217;re fine. You&amp;#8217;ll get in trouble if you want to use it to version positional data (e.g. individual items in an ordered list) or relational data (e.g. a family tree).&lt;/p&gt;</description>
      <pubDate>Wed, 07 Nov 2007 00:17:39 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:24:62</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/24</link>
    </item>
    <item>
      <title>Good RoR plugins replied by woods @ Tue, 06 Nov 2007 23:55:01 -0000</title>
      <description>&lt;p&gt;Here are my usual suspects:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;exception_notification &amp;#8211; Mandatory for production. sends you an email every time an exception is raised.&lt;/li&gt;
		&lt;li&gt;rspec, rspec_on_rails &amp;#8211; Easier, more readable testing than the default Test::Unit, in my opinion.&lt;/li&gt;
		&lt;li&gt;haml &amp;#8211; Cleaner &lt;span class="caps"&gt;HTML&lt;/span&gt;/CSS, both in your views, and in &amp;#8220;view source&amp;#8221; in your browser.&lt;/li&gt;
		&lt;li&gt;annotate models &amp;#8211; Adds a rake task that puts a description of the database table in a comment block at the top of each of your models. &lt;/li&gt;
		&lt;li&gt;redhillonrails_core &amp;#8211; Provides support for foreign key enforcement in your migrations, among a couple other features. Useful for database nerds like me. &lt;/li&gt;
		&lt;li&gt;assert_request &amp;#8211; Allows you to declare and enforce the method/params interface to all of your actions. This can make your application more secure, reduces validation code in your actions, and can prevent some obscure bugs when your views call your actions with incomplete/unexpected information.&lt;/li&gt;
		&lt;li&gt;atom_feed_helper &amp;#8211; Makes it easy to create feeds for your indexes. Might be built into rails 2.0 now?&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Those are in rough order of importance to me, with the top four being almost universal in my projects. The rest of them depend more on the app&amp;#8217;s features and how robust it needs to be.&lt;/p&gt;


	&lt;p&gt;Sorry there are no links, but I procrastinated long enough on this reply! A quick google search should turn each of them up.&lt;/p&gt;


	&lt;p&gt;Maybe after the next meeting ActiveScaffold will be in there too&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Tue, 06 Nov 2007 23:55:01 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:24:60</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/24</link>
    </item>
    <item>
      <title>Good RoR plugins replied by Andrew @ Mon, 22 Oct 2007 15:12:57 -0000</title>
      <description>&lt;p&gt;I was wondering if we could list the plugins for RoR in this forum, that are useful? In particular, I was wondering about the plugin that lets you do revision history.&lt;/p&gt;</description>
      <pubDate>Mon, 22 Oct 2007 15:12:57 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:24:56</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/24</link>
    </item>
    <item>
      <title>RoR Technical Questions replied by woods @ Wed, 10 Oct 2007 16:05:00 -0000</title>
      <description>&lt;p&gt;Sounds like a great plan. I&amp;#8217;ve really enjoyed that workflow before too, but just wound up there through a combination of luck and procrastinating on the hard parts: figure out what the user interface should look like, so you know what you&amp;#8217;re building, for whom, and why. Then figure out the models for how you&amp;#8217;re going to store the information and do the application logic. Finally, write the controllers to glue everything together (usually the most nebulous part), using your ideal URLs as a guide. Maybe do several iterations like that for each distinct chunk of functionality in the site. Neat. Maybe I&amp;#8217;ll &lt;strong&gt;intentionally&lt;/strong&gt; try for that workflow next time!&lt;/p&gt;</description>
      <pubDate>Wed, 10 Oct 2007 16:05:00 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:9:51</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/9</link>
    </item>
    <item>
      <title>RoR Technical Questions replied by Andrew @ Wed, 10 Oct 2007 14:37:02 -0000</title>
      <description>&lt;p&gt;wow&amp;#8230; thanks for the help, guys! This confirms how I might want to proceed: finish making my interface mockups, think of good urls for them, then think about what controllers are needed.&lt;/p&gt;


	&lt;p&gt;Edit: I already have (most) of my models figured out.&lt;/p&gt;</description>
      <pubDate>Wed, 10 Oct 2007 14:37:02 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:9:50</guid>
      <author>Andrew</author>
      <link>http://statecollegeruby.org/forums/2/topics/9</link>
    </item>
    <item>
      <title>RoR Technical Questions replied by woods @ Wed, 10 Oct 2007 14:12:59 -0000</title>
      <description>&lt;p&gt;Hey Andrew,&lt;/p&gt;


	&lt;p&gt;Every view does need a controller. You can put static &lt;span class="caps"&gt;HTML&lt;/span&gt; pages in /public, but if it has ruby code in it, it will need to go in /app/views/#{controller_name}/. Note the path there&amp;#8212;the controller/view relationship is a strict hierarchy in RoR, where each view belongs to one and only one controller.  This is used to represent the default one-to-one relationship between controller actions and their views. Each controller action (public method of the controller) will automatically render its corresponding view in /app/views/#{controller_name}/#{action_name}.rhtml (or .html.erb if you&amp;#8217;re on edge rails). You can and should think of each view as being a template for its corresponding action.&lt;/p&gt;


	&lt;p&gt;However, things get more nebulous (creative?) with models and controllers. Whereas the relationship between controllers and views is fairly strictly defined, the relationship between models and controllers is &lt;strong&gt;wide open&lt;/strong&gt;. Any controller can and should call upon any model. How you organize your controllers in your application is completely up to you.&lt;/p&gt;


	&lt;p&gt;There are a couple guiding principles that help out a lot though. First of all, you don&amp;#8217;t want your controllers to have a million actions. After my controllers start getting more than 10 actions, alarm bells start going off. Granted, each situation is different, and it&amp;#8217;s ridiculous for me to mention a firm figure for the number of actions you should have in a controller, but I wanted to give you some idea of the range I&amp;#8217;m usually thinking of.&lt;/p&gt;


	&lt;p&gt;Second of all, it&amp;#8217;s considered good form to keep the controller actions themselves as short and succinct as possible, and push the guiding application logic down to the models, and any rendering logic up in to view helpers (also using view partials to reduce repetition). Here&amp;#8217;s the original article on &amp;#8220;Skinny Controller, Fat Model&amp;#8221;, followed by an even more succinct writeup on the same topic on the Rails Way (same guy, Jamis Buck):&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model"&gt;http://weblog.jamisbuck.org/2006/10/18/skinny-c&amp;#8230;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.therailsway.com/2007/6/1/railsconf-recap-skinny-controllers"&gt;http://www.therailsway.com/2007/6/1/railsconf-r&amp;#8230;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;So how do you decide what controllers to have in the first place? What do you call them?&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re designing an application using &lt;span class="caps"&gt;REST&lt;/span&gt; principles, then each controller represents a &amp;#8220;resource&amp;#8221; that people would want to access. For example, if you&amp;#8217;re designing a bookstore, then you might very well have a /books controller (REST controllers are usually plural). People could list the books  using a &lt;span class="caps"&gt;GET&lt;/span&gt; request to /books, look at a particular book using &lt;span class="caps"&gt;GET&lt;/span&gt; /books/23, and the admin interface would remove a book by issuing a &lt;span class="caps"&gt;DELETE&lt;/span&gt; request to /books/46. The actions that are available are generally limited to the standard  create, show, index, update, delete, edit, and new, which is a feature of &lt;span class="caps"&gt;REST&lt;/span&gt;. Once you know the resource name and what it represents, you pretty much know how to use it.&lt;/p&gt;


	&lt;p&gt;Note that there&amp;#8217;s no rule that your resource (controller) matches a model! For example, Amazon might have a /products controller, which would encompass their Book model, their HomeAndGarden model, and their Clothing model. The key is that they decided that it made sense to expose &amp;#8220;products&amp;#8221; as a single resource, so that&amp;#8217;s how they designed their (hypothetical) &lt;span class="caps"&gt;REST&lt;/span&gt; controller. That controller&amp;#8217;s actions would then be dealing with all the different models.&lt;/p&gt;


	&lt;p&gt;That said, in practice I find that many simple &lt;span class="caps"&gt;REST&lt;/span&gt; applications &lt;strong&gt;do&lt;/strong&gt; wind up having a one-to-one relationship between models and controllers.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re not doing RESTful controllers, then you have more flexibility. You can stick with the default scaffolding actions, or you can have entirely different ones. You can lay out your controllers however you&amp;#8217;d like. You can have actions like /admin_interface/run_nightly_reports . At this point, how you lay out your controllers is largely a matter of taste and experimentation. On the one hand, you don&amp;#8217;t want too many controllers, because then it gets cumbersome to reference them all in your links, because you&amp;#8217;re always having to specify the controller (you don&amp;#8217;t have to specify the controller in link_to params if the linked-to action is in the same controller as the current view). On the other hand, controllers with 50 actions can look and feel a bit ridiculous.&lt;/p&gt;


	&lt;p&gt;The tradeoffs in non-RESTful controller/action design are similar to how you&amp;#8217;d design your module/function layout in a procedural program. A lot of times, the final guiding principle for me is how the URLs look and behave. Generally, when I&amp;#8217;ve hit upon the right combination, the URLs make sense and flow between one another logically. Sometimes I&amp;#8217;ll even start the whole process by designing all the URLs and their interplay first, and then figuring out how to implement them (I always do it this way for &lt;span class="caps"&gt;REST&lt;/span&gt; controllers).&lt;/p&gt;


	&lt;p&gt;Finally, you don&amp;#8217;t have to settle on one controller design for your application. Quite frequently, we&amp;#8217;ll have to settle for one non-RESTful controller in an otherwise RESTful application. Sometimes you run into views/actions that just don&amp;#8217;t want to be shoehorned into &lt;span class="caps"&gt;CRUD&lt;/span&gt;. Hopefully the non-RESTful part is not a core part of the application though&amp;#8212;it&amp;#8217;s nice to have a consistent style of interface for the core functions.&lt;/p&gt;


	&lt;p&gt;Hope this helps, looking forward to others&amp;#8217; feedback.&lt;/p&gt;


	&lt;p&gt;Scott&lt;/p&gt;</description>
      <pubDate>Wed, 10 Oct 2007 14:12:59 -0000</pubDate>
      <guid isPermaLink="false">statecollegeruby.org:2:9:49</guid>
      <author>woods</author>
      <link>http://statecollegeruby.org/forums/2/topics/9</link>
    </item>
  </channel>
</rss>
