<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Dev411 Blog: Category rails</title>
  <subtitle type="html">John Wang on Technology</subtitle>
  <id>tag:www.dev411.com,2005:Typo</id>
  <generator uri="http://www.typosphere.org" version="4.0">Typo</generator>
  <link href="http://www.dev411.com/blog/xml/atom/category/feed.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.dev411.com/blog/tag/rails" rel="alternate" type="text/html"/>
  <updated>2007-06-17T01:59:40-05:00</updated>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:81a8f9a2-64fa-49a2-b3cc-78f9db208593</id>
    <published>2007-06-16T17:36:00-05:00</published>
    <updated>2007-06-17T01:59:40-05:00</updated>
    <title type="html">Typo - Upgrading to 4.1.1</title>
    <link href="http://www.dev411.com/blog/2007/06/16/typo-upgrading-to-4-1-1" rel="alternate" type="text/html"/>
    <category term="typo" scheme="http://www.dev411.com/blog/tag/typo" label="typo"/>
    <category term="rails" scheme="http://www.dev411.com/blog/tag/rails" label="rails"/>
    <summary type="html">&lt;p&gt;I finally got around to upgrading from Typo 4.0.0 r1188 to Typo 4.1.1 and it was pretty smooth. I had held off for a while because Typo was changing a lot under the covers with some much needed refactoring and I have a few hacks I didn't feel like modifying with every minor update.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;I finally got around to upgrading from Typo 4.0.0 r1188 to Typo 4.1.1 and it was pretty smooth. I had held off for a while because Typo was changing a lot under the covers with some much needed refactoring and I have a few hacks I didn't feel like modifying with every minor update.&lt;/p&gt;

&lt;p&gt;I ran into some initial issues because I was installing from the tarball and not the gem. I had an older version of Rails and Typo 4.1.1 needs Rails 1.2.3. Running "rake migrate" doesn't check the Rails version and would just abort. Eventually I guessed the problem reading the &lt;span class="fix"&gt;--trace&lt;/span&gt; output and I was on my way. The other curiosity was that Gem's &lt;span class="fix"&gt;--install-dependencies&lt;/span&gt; didn't work for me. I still had to install/upgrade rake, activerecord and a number of other packages before installing rails using gem. I think it would be nice if &lt;span class="fix"&gt;--install-dependencies&lt;/span&gt; did install those or at least showed all the packages that were needed in one report instead of just showing one and aborting. Perhaps there was something wrong with my setup. With CPAN, you get to see all the required dependencies in the first report and it will install them all for you in one shot. However, compared to gem, CPAN might show too much information by default. Perhaps the majority of the information CPAN shows should be moved to a non-default verbose mode.&lt;/p&gt;

&lt;p&gt;I have a few hacks running on this blog so the update consisted of the following:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Theme: This blog runs a modified version of Azure which used a table that no longer exists in 4.1.1. Because of this Typo wouldn't start. To get around this I did a manual SQL update of the &lt;span class="fix"&gt;settings&lt;/span&gt; column in the &lt;span class="fix"&gt;blogs&lt;/span&gt; table to reset the theme to Azure before migrating my mods over. The settings field is an aggregate field with serialized information delimited by carriage returns. I prefer using JSON to serialize complex data structures stored in a single db field which I think is much more maintainable.&lt;/li&gt;
  &lt;li&gt;Categories Sidebar: This had moved from &lt;span class="fix"&gt;./components/plugins/sidebar/category&lt;/span&gt; to &lt;span class="fix"&gt;./vendor/plugins/category_sidebar&lt;/span&gt;. Now that the &lt;a href="http://blog.typosphere.org/articles/2007/04/15/the-futur-of-typo-sidebar-plugins"&gt;sidebars are stand-alone Rails plugins&lt;/a&gt;, it makes more sense for me to turn my custom Category sidebar into its own thing instead of modifying the existing one.&lt;/li&gt;
  &lt;li&gt;Notable Links: I put together some &lt;a href="/blog/2006/09/02/notable-social-bookmarking-networking-for-typo"&gt;social bookmarking links&lt;/a&gt; a while back for Typo 4.0.0 and it was reported to no longer function with 4.1.1. A little checking showed that &lt;span class="fix"&gt;article.location&lt;/span&gt; was no longer available and replaced by &lt;span class="fix"&gt;article.permalink_url&lt;/span&gt;. Both 4.1.1 and 4.0.0 versions of the Notable view are now available. The method call used to display the article body in &lt;span class="fix"&gt;./views/articles/read.rhtml&lt;/span&gt; had also changed. This is used as a reference point to insert new code.&lt;/li&gt;
  &lt;li&gt;Table of Contents: The &lt;a href="/blog/2006/06/26/adding-a-toc-to-typo"&gt;Table of Contents&lt;/a&gt; solution I had put together had also broken and is now fixed. It is interesting to see the progression of link creation from 2.6.0 to 4.0.0 to 4.1.1. The previous two used Rails' &lt;span class="fix"&gt;link_to&lt;/span&gt; helper but 4.1.1 creates the HTML manually.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The rest of the changes were pretty straight-forward to carry across, including the category icons and &lt;span class="fix"&gt;routes.rb&lt;/span&gt; mods I use.&lt;/p&gt;

&lt;p&gt;Overall, the upgrade was smooth after I figured out I needed to upgrade Rails from the &lt;span class="fix"&gt;rake migrate&lt;/span&gt; failure. I like the refactoring of the plugins and look forward to making some.&lt;/p&gt;

&lt;p&gt;Fr&#233;d&#233;ric de Villamil, the current Typo maintainer, menioned that 5.0 is coming and will have the following features:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Plugin Manager: to download and install plugins from the official repository&lt;/li&gt;
  &lt;li&gt;Advanced Theme Manager: to download and install themes from the official themes repository&lt;/li&gt;
  &lt;li&gt;Real Multi-User Support&lt;/li&gt;
  &lt;li&gt;OpenID Support&lt;/li&gt;
  &lt;li&gt;and more....&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I've been pleasantly surprised with the development activity happening around Typo and can't wait for version 5.0.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:1acd4e66-6803-4f72-b9ce-69f7aa92ebe2</id>
    <published>2006-08-10T12:20:00-05:00</published>
    <updated>2007-06-16T12:30:24-05:00</updated>
    <title type="html">Rails 1.1.4 LOAD_PATH vulnerability</title>
    <link href="http://www.dev411.com/blog/2006/08/10/rails-1-1-4-load_path-vulnerability" rel="alternate" type="text/html"/>
    <category term="security" scheme="http://www.dev411.com/blog/tag/security" label="security"/>
    <category term="rails" scheme="http://www.dev411.com/blog/tag/rails" label="rails"/>
    <summary type="html">&lt;p&gt;A couple of people have blogged about their use of the "elite hacking tool &lt;span class="fix"&gt;diff -r&lt;/span&gt;" to identify the problem solved by the &lt;a href="http://weblog.rubyonrails.com/2006/8/9/rails-1-1-5-mandatory-security-patch-and-other-tidbits"&gt;Rails 1.1.5 Mandatory Mystery Patch&lt;/a&gt;. The problem is that Rails accepted LOAD_PATH as a HTTP request header with any file upload so a hacker could upload ruby controllers and then execute them by accessing the newly exposed URIs. This is discussed by &lt;a href="http://blog.koehntopp.de/archives/1367-Ruby-On-Rails-Mandatory-Mystery-Patch.html"&gt;Kristian K&#246;hntopp&lt;/a&gt; and &lt;a href="http://blog.evanweaver.com/articles/2006/08/10/explanation-of-the-rails-security-vulnerability-in-1-1-4-others"&gt;Evan Weaver&lt;/a&gt;.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;A couple of people have blogged about their use of the "elite hacking tool &lt;span class="fix"&gt;diff -r&lt;/span&gt;" to identify the problem solved by the &lt;a href="http://weblog.rubyonrails.com/2006/8/9/rails-1-1-5-mandatory-security-patch-and-other-tidbits"&gt;Rails 1.1.5 Mandatory Mystery Patch&lt;/a&gt;. The problem is that Rails accepted LOAD_PATH as a HTTP request header with any file upload so a hacker could upload ruby controllers and then execute them by accessing the newly exposed URIs. This is discussed by &lt;a href="http://blog.koehntopp.de/archives/1367-Ruby-On-Rails-Mandatory-Mystery-Patch.html"&gt;Kristian K&#246;hntopp&lt;/a&gt; and &lt;a href="http://blog.evanweaver.com/articles/2006/08/10/explanation-of-the-rails-security-vulnerability-in-1-1-4-others"&gt;Evan Weaver&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Brian Hogan reports the 1.1.5 fix does not work with Mongrel and &lt;a href="http://wrath.rubyonrails.org/pipermail/rails/2006-August/059976.html"&gt;Sander Land's fix&lt;/a&gt; is needed. The issue is being discussed on &lt;a href="http://www.ruby-forum.com/topic/76671"&gt;Ruby Forums&lt;/a&gt; and here's the latest patch':&lt;/p&gt;

&lt;pre&gt;--- routing.rb.orig     2006-08-10 12:20:12.830325000 -0500
+++ routing.rb  2006-08-10 12:20:26.043147000 -0500
@@ -273,7 +273,7 @@
             $LOAD_PATH.select do |base|
               base = File.expand_path(base)
               extended_root = File.expand_path(RAILS_ROOT)
-
base.match(/\A#{Regexp.escape(extended_root)}\/*#{file_kinds(:lib) *
'|'}/) || base =~ %r{rails-[\d.]+/builtin}
+
base.match(/\A#{Regexp.escape(extended_root)}\/+(#{file_kinds(:lib) *
'|'})/) || base =~ %r{rails-[\d.]+/builtin}
             end
           else
             $LOAD_PATH&lt;/pre&gt;

&lt;!--div class="quote_simple"&gt;Fix:&lt;br /&gt;
actionpack-1.12.4\lib\action_controller\routing.rb: 276&lt;br /&gt;
CHANGE&lt;br /&gt;
base.match(/\A#{Regexp.escape(extended_root)}\/*#{file_kinds(:lib) * 
'|'}/) || base =~ %r{rails-[\d.]+/builtin}&lt;br /&gt;
TO&lt;br /&gt;
base.match(/\A#{Regexp.escape(extended_root)}\/*(?:#{file_kinds(:lib) * 
'|'})/) || base =~ %r{rails-[\d.]+/builtin}&lt;/div--&gt;

&lt;p&gt;37Signals is getting some flack for keeping this a secret when it's so easy to discover what the issue is. Hopefully they'll learn their lesson. They'd also come across as more professional without things like this: &lt;a href="http://www.flickr.com/photos/planetargon/127984254/"&gt;http://www.flickr.com/photos/planetargon/127984254/&lt;/a&gt;.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:31fd117d-06ec-41c9-8dba-f81073ad0d58</id>
    <published>2006-08-10T10:37:00-05:00</published>
    <updated>2007-06-16T12:30:24-05:00</updated>
    <title type="html">Rails 1.1.5 routing vulnerability</title>
    <link href="http://www.dev411.com/blog/2006/08/10/rails-1-1-5-routing-vulnerability" rel="alternate" type="text/html"/>
    <category term="security" scheme="http://www.dev411.com/blog/tag/security" label="security"/>
    <category term="rails" scheme="http://www.dev411.com/blog/tag/rails" label="rails"/>
    <summary type="html">&lt;p&gt;People are reporting a &lt;a href="http://www.ruby-forum.com/topic/76671"&gt;Rails 1.1.5 routing vulerability&lt;/a&gt; where accessing certain URIs will crash Rails. The problem has been reported on Mongrel, WeBrick and FastCGI. &lt;a href="http://www.bofh.org.uk/articles/2006/08/10/working-round-the-rails-showstopper"&gt;Piers Cawley&lt;/a&gt; is working on an explicit routes fix for Typo and discusses the issue on his blog. This has not been mentioned on the &lt;a href="http://weblog.rubyonrails.com"&gt;RoR blog&lt;/a&gt; yet. Good thing for public forums.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;People are reporting a &lt;a href="http://www.ruby-forum.com/topic/76671"&gt;Rails 1.1.5 routing vulerability&lt;/a&gt; where accessing certain URIs will crash Rails. The problem has been reported on Mongrel, WeBrick and FastCGI. &lt;a href="http://www.bofh.org.uk/articles/2006/08/10/working-round-the-rails-showstopper"&gt;Piers Cawley&lt;/a&gt; is working on an explicit routes fix for Typo and discusses the issue on his blog. This has not been mentioned on the &lt;a href="http://weblog.rubyonrails.com"&gt;RoR blog&lt;/a&gt; yet. Good thing for public forums.&lt;/p&gt;

&lt;p&gt;While this is being fixed you can take steps to protect your own apps by ensuring only valid urls are allowed to make it to your Rails app.&lt;/p&gt;

&lt;p&gt;Some problem URIs that have been mentioned include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;active_support/dependencies&lt;/li&gt;
&lt;li&gt;breakpoint_client&lt;/li&gt;
&lt;li&gt;builder/blankslate&lt;/li&gt;
&lt;li&gt;cgi&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I've added some mod_rewrite rules for now but I'm hoping there will be a better solution soon.&lt;/p&gt;

&lt;p&gt;If you are using 1.1.5 with Mongrel, see &lt;a href="http://www.dev411.com/blog/2006/08/10/rails-1-1-4-load_path-vulnerability"&gt;Rails 1.1.4 LOAD_PATH vulernability&lt;/a&gt; for a patch to make them work together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;This is now mentioned &lt;a href="http://weblog.rubyonrails.org/2006/8/10/rails-1-1-6-backports-and-full-disclosure"&gt;on the RoR blog&lt;/a&gt; with their recommended mod_rewrite fixes for Apache and lighttpd if you can't upgrade to 1.1.6 right away:&lt;/p&gt;

&lt;p&gt;Apache:&lt;/p&gt;

&lt;p&gt;RewriteRule ^(app|components|config|db|doc|lib|log|public|script|test|tmp|vendor)/ - [F]&lt;/p&gt;

&lt;p&gt;lighttpd:&lt;/p&gt;

&lt;p&gt;url.rewrite-once = ( "^/(app|components|config|db|doc|lib|log|public|script|test|tmp|vendor)/" =&gt; "index.html" )&lt;/p&gt;
</content>
  </entry>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:9e4a4521-59c8-4dd7-b698-e201f4eb144a</id>
    <published>2006-08-10T01:14:00-05:00</published>
    <updated>2007-06-16T12:30:24-05:00</updated>
    <title type="html">Upgrading Typo 4.0.0 to Rails 1.1.5/1.1.6</title>
    <link href="http://www.dev411.com/blog/2006/08/10/upgrading-typo-4-0-0-to-rails-1-1-5" rel="alternate" type="text/html"/>
    <category term="security" scheme="http://www.dev411.com/blog/tag/security" label="security"/>
    <category term="typo" scheme="http://www.dev411.com/blog/tag/typo" label="typo"/>
    <category term="rails" scheme="http://www.dev411.com/blog/tag/rails" label="rails"/>
    <summary type="html">&lt;p&gt;It was recently announced that &lt;a href="http://weblog.rubyonrails.org/2006/8/9/rails-1-1-5-mandatory-security-patch-and-other-tidbits"&gt;Rails 1.1.0, 1.1.1, 1.1.2, and 1.1.4. have a very serious security hole&lt;/a&gt;. Although the RoR blog hasn't discussed exactly what the hole is, it has been rumored to involve uploading of .rb files to execute arbitrary code on the server (UPDATE: &lt;a href="http://www.dev411.com/blog/2006/08/10/rails-1-1-4-load_path-vulernability"&gt;now confirmed&lt;/a&gt;). Typo only allows file uploads by administrators so certain applications may be somewhat safer. (UPDATE: Running arbitrary code was fixed in 1.1.5 however you could still crash it. 1.1.6 has been released to fix these lingering bugs. Just change 1.1.5 to 1.1.6 below).&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;It was recently announced that &lt;a href="http://weblog.rubyonrails.org/2006/8/9/rails-1-1-5-mandatory-security-patch-and-other-tidbits"&gt;Rails 1.1.0, 1.1.1, 1.1.2, and 1.1.4. have a very serious security hole&lt;/a&gt;. Although the RoR blog hasn't discussed exactly what the hole is, it has been rumored to involve uploading of .rb files to execute arbitrary code on the server (UPDATE: &lt;a href="http://www.dev411.com/blog/2006/08/10/rails-1-1-4-load_path-vulernability"&gt;now confirmed&lt;/a&gt;). Typo only allows file uploads by administrators so certain applications may be somewhat safer. (UPDATE: Running arbitrary code was fixed in 1.1.5 however you could still crash it. 1.1.6 has been released to fix these lingering bugs. Just change 1.1.5 to 1.1.6 below).&lt;/p&gt;

&lt;p&gt;Scott Laird is working on releasing Typo 4.0.1 (&lt;a href="http://scottstuff.net/blog/articles/2006/08/10/typo-4-0-1"&gt;now released&lt;/a&gt;) which will include Rails 1.1.5 but until then, or if you don't want to upgrade Typo, you can simply upgrade the Rails used by Typo by installing the 1.1.5 &lt;span class="fix"&gt;vendor/rails&lt;/span&gt; directory over the existing one. Here are some steps:&lt;/p&gt;

&lt;pre&gt;$ cd /tmp
$ wget http://rubyforge.org/frs/download.php/12258/rails-1.1.5.tgz
$ tar -zxf rails-1.1.5.tgz
$ cd rails/vendor
$ tar -zcf rails-1.1.5-vendor-rails.tgz rails
$ mv rails-1.1.5-vendor-rails.tgz /path/to/typo/vendor
$ cd /path/to/typo/vendor
$ tar -zxf rails-1.1.5-vendor-rails.tgz&lt;/pre&gt;
&lt;p&gt;To verify that Rails has been updated you can view the &lt;span class="fix"&gt;version.rb&lt;/span&gt; file which should now give you the following:&lt;/p&gt;
&lt;pre&gt;$ cat rails/railties/lib/rails/version.rb
module Rails
  module VERSION #:nodoc:
    MAJOR = 1
    MINOR = 1
    TINY  = 5

    STRING = [MAJOR, MINOR, TINY].join('.')
  end
end&lt;/pre&gt;

&lt;p&gt;You'll probably want to back up the existing &lt;span class="fix"&gt;vendor/rails&lt;/span&gt; directory as this will extract the 1.1.5 files over it. If you simply swap &lt;span class="fix"&gt;vendor&lt;/span&gt; directories, you'll get a lot of missing requirements errors (e.g. redcloth, bluecloth, rubypants, uuidtools, etc.) because rails isn't the only thing installed under &lt;span class="fix"&gt;vendor&lt;/span&gt; for Typo.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:af2bb512b69726744a3c11699feb93c2</id>
    <published>2006-07-23T12:59:00-05:00</published>
    <updated>2007-06-16T12:30:23-05:00</updated>
    <title type="html">Mongrel and non-root URIs</title>
    <link href="http://www.dev411.com/blog/2006/07/23/mongrel-and-non-root-uris" rel="alternate" type="text/html"/>
    <category term="typo" scheme="http://www.dev411.com/blog/tag/typo" label="typo"/>
    <category term="rails" scheme="http://www.dev411.com/blog/tag/rails" label="rails"/>
    <summary type="html">&lt;p&gt;Two weeks ago, Scott Laird posted a Mongrel patch to the Typo list to make it work with non-root URIs. I'm particularly interested in this because Mongrel is getting more mindshare and my blog uses a non-root URI. The patch has been submitted to Zed Shaw for inclusion but, until it's in, here are some links since I don't think this is easy to find:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.mail-archive.com/typo-list@rubyforge.org/msg02733.html"&gt;archived email&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.mail-archive.com/typo-list@rubyforge.org/msg02733/mongrel.diff"&gt;mongrel.diff patch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; This is now included in &lt;a href="http://www.mail-archive.com/mongrel-users@rubyforge.org/msg00596.html"&gt;Mongrel 0.3.13.4 pre-release&lt;/a&gt;.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;Two weeks ago, Scott Laird posted a Mongrel patch to the Typo list to make it work with non-root URIs. I'm particularly interested in this because Mongrel is getting more mindshare and my blog uses a non-root URI. The patch has been submitted to Zed Shaw for inclusion but, until it's in, here are some links since I don't think this is easy to find:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.mail-archive.com/typo-list@rubyforge.org/msg02733.html"&gt;archived email&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.mail-archive.com/typo-list@rubyforge.org/msg02733/mongrel.diff"&gt;mongrel.diff patch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; This is now included in &lt;a href="http://www.mail-archive.com/mongrel-users@rubyforge.org/msg00596.html"&gt;Mongrel 0.3.13.4 pre-release&lt;/a&gt;.&lt;/p&gt;

</content>
  </entry>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:4affdc8fb3cb2fc9e8b14d8a6252ebe3</id>
    <published>2006-07-20T17:22:00-05:00</published>
    <updated>2007-06-16T12:30:23-05:00</updated>
    <title type="html">Prototype's future in Rails</title>
    <link href="http://www.dev411.com/blog/2006/07/20/prototypes-future-in-rails" rel="alternate" type="text/html"/>
    <category term="rails" scheme="http://www.dev411.com/blog/tag/rails" label="rails"/>
    <category term="ajax" scheme="http://www.dev411.com/blog/tag/ajax" label="ajax"/>
    <category term="scriptaculous" scheme="http://www.dev411.com/blog/tag/scriptaculous" label="scriptaculous"/>
    <category term="prototype" scheme="http://www.dev411.com/blog/tag/prototype" label="prototype"/>
    <summary type="html">&lt;p&gt;The future of Prototype (the JavaScript AJAX library), both as a stand-alone library and as a part of Rails, is being discussed by the community on the &lt;span class="fix"&gt;rails-spinoffs&lt;/span&gt; list. The primary concerns appear to be:&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;The future of Prototype (the JavaScript AJAX library), both as a stand-alone library and as a part of Rails, is being discussed by the community on the &lt;span class="fix"&gt;rails-spinoffs&lt;/span&gt; list. The primary concerns appear to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prototype is driven by one person who hasn't been very active on the list. Some patches are integrated but often without communication&lt;/li&gt;
&lt;li&gt;it is difficult for others to contribute&lt;/li&gt;
&lt;li&gt;there is no visibility into the roadmap for prototype&lt;/li&gt;
&lt;li&gt;prototype is "falling behind" relative to other libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The one person vs. community aspect of the discussion reminds me of Red Hat rebuilds. When Red Hat stopped distributing free binaries, a number of projects took advantage of GPL and started providing free rebuild binaries. At first, &lt;a href="http://www.whiteboxlinux.org/"&gt;White Box Enterprise Linux (WBEL)&lt;/a&gt; was the most popular and wide-spread rebuild but it was maintained by one person who occasionally got busy. It was eventually overtaken by &lt;a href="http://www.centos.org"&gt;CentOS&lt;/a&gt; which is maintained by a community.&lt;/p&gt;

&lt;p&gt;For now, Prototype will remain popular because it comes bundled with Rails and is the basis for RJS and Scriptaculous. Thomas Fuchs has come out and said, "script.aculo.us will always depend on Prototype". Still, I wonder if community maintenance isn't a better way to go for something that's relied on by so many people. Some are even concerned that Rails itself will become less viable if it continues to attach itself to Prototype and the project management doesn't change.&lt;/p&gt;

&lt;p&gt;You can follow the thread by going to the list &lt;a href="http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-July/thread.html"&gt;archives page&lt;/a&gt; and looking for the subject name "Documenting Prototype...". &lt;a href="http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-July/005139.html"&gt;Greg Hill's post&lt;/a&gt; seems like a reasonable place to start.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:1fad5773efca314b216a68fd5abe5645</id>
    <published>2006-06-26T16:37:00-05:00</published>
    <updated>2007-06-17T01:51:15-05:00</updated>
    <title type="html">Adding a TOC to Typo</title>
    <link href="http://www.dev411.com/blog/2006/06/26/adding-a-toc-to-typo" rel="alternate" type="text/html"/>
    <category term="typo" scheme="http://www.dev411.com/blog/tag/typo" label="typo"/>
    <category term="hacks" scheme="http://www.dev411.com/blog/tag/hacks" label="hacks"/>
    <category term="rails" scheme="http://www.dev411.com/blog/tag/rails" label="rails"/>
    <summary type="html">&lt;p&gt;I've been using MediaWiki for a while and wanted its ability to auto-generate Table of contents for pages with multiple articles such as the homepage and the category pages. Typo is a Ruby on Rails app so you'll need to be somewhat familiar with it to make enhancments. I have this running on Typo 4.1.1, 4.0.0 r1188 and 2.6.0.&lt;/p&gt;

&lt;p&gt;I came up with the following but it's still in the early stages:&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;I've been using MediaWiki for a while and wanted its ability to auto-generate Table of contents for pages with multiple articles such as the homepage and the category pages. Typo is a Ruby on Rails app so you'll need to be somewhat familiar with it to make enhancments. I have this running on Typo 4.1.1, 4.0.0 r1188 and 2.6.0.&lt;/p&gt;

&lt;p&gt;I came up with the following but it's still in the early stages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add name attribute to article links:&lt;/strong&gt; We want to add the HTML name attribute to the article links so we can anchor to them. To do this, edit the &lt;span class="fix"&gt;app/helpers/application_helper.rb&lt;/span&gt; file and modify the appropriate method shown below with the changes in highlighted.&lt;/p&gt;

&lt;p&gt;For Typo 4.1.1:&lt;/p&gt;
&lt;pre&gt;def link_to_permalink(item, title, anchor=nil&lt;span class="highlight"&gt;, name=nil&lt;/span&gt;)
  anchor = "##{anchor}" if anchor
  &lt;span class="highlight"&gt;name   = " name=\"#{name}\"" if name&lt;/span&gt;
  "&amp;lt;a href=\"#{item.permalink_url}#{anchor}\"&lt;span class="highlight"&gt;#{name}&lt;/span&gt;&amp;gt;#{title}&amp;lt;/a&amp;gt;"
end&lt;/pre&gt;

&lt;p&gt;For Typo 4.0.0:&lt;/p&gt;
&lt;pre&gt;def item_link(title, item, anchor=nil)
  &lt;span class="highlight"&gt;if item.is_a?(Article) &amp;amp;&amp;amp; anchor != 'comments'&lt;/span&gt;
  &lt;span class="highlight"&gt;&amp;amp;&amp;amp; anchor != 'trackbacks'&lt;/span&gt;
    &lt;span class="highlight"&gt;link_to title, item.location(anchor), :name =&gt; item.id&lt;/span&gt;
  &lt;span class="highlight"&gt;else&lt;/span&gt;
    link_to title, item.location(anchor)
  &lt;span class="highlight"&gt;end&lt;/span&gt;
end&lt;/pre&gt;

&lt;p&gt;For Typo 2.6.0:&lt;/p&gt;
&lt;pre&gt;def article_link(title, article, anchor=nil)
  link_to title, article_url(article,true,anchor),
    &lt;span class="highlight"&gt;:name =&amp;gt; article.id&lt;/span&gt;
end&lt;/pre&gt;

&lt;p&gt;For Typo 4.1.1, you will also need to edit the &lt;span class="fix"&gt;app/views/articles/index.rhtml&lt;/span&gt; file and make the following modification:&lt;/p&gt;

&lt;pre&gt;&amp;lt;%= link_to_permalink article,article.title&lt;span class="highlight"&gt;,nil,article.id&lt;/span&gt; %&amp;gt;&lt;/pre&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add TOC template:&lt;/strong&gt; I decided to create a separate template to handle the TOC. I used the following file name:&lt;/p&gt;

&lt;p&gt;&lt;span class="fix"&gt;app/views/articles/_articles_toc.rhtml&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;which consists of the following (I didn't use &lt;span class="fix"&gt;link_to&lt;/span&gt; because the uri is only the &lt;span class="fix"&gt;article.id&lt;/span&gt;):&lt;/p&gt;
&lt;pre&gt;
&amp;lt;div id="articles_toc"&amp;gt;&amp;lt;p&amp;gt;Table of Contents&amp;lt;/p&amp;gt;
  &amp;lt;ul&amp;gt;
  &amp;lt;% for article in @articles -%&amp;gt;
    &amp;lt;li&amp;gt;
      &amp;lt;a href="#&amp;lt;%= article.id %&amp;gt;"&amp;gt;
        &amp;lt;%= article.title %&amp;gt;
      &amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
  &amp;lt;% end -%&amp;gt;
  &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Call the TOC template:&lt;/strong&gt; To call the TOC template from &lt;span class="fix"&gt;index.rhtml&lt;/span&gt;, add the following at the top of &lt;span class="fix"&gt;app/views/articles/index.rhtml&lt;/span&gt;&lt;!--I tried to pass the articles object but it wasn't working; I'll look at it again in a bit.--&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;%= render_partial "articles_toc" %&amp;gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;Style with CSS:&lt;/strong&gt; You'll probably want to style the TOC using CSS. Since the TOC feature is a hack it may be easier to put it in a supplementary CSS file so it won't get overwritten when you switch themes.&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;TODO - Admin Console:&lt;/strong&gt; To make this a full-fledged enhancement, there should be a toggle in the admin console to turn the TOC on and off. Right now this also shows the list for the index and category pages even when there's just one article on the page. It may be worthwhile to configure a mininum number of articles before the TOC is displayed.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I'll run this on this blog for now since I like having a quick way to see the list of articles on the page.&lt;/p&gt;

&lt;p&gt;UPDATE 1: I added the number of comments to the existing TOC here. You can get the number of comments by using &lt;span class="fix"&gt;article.comments.length&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;UPDATE 2: I also looked at turning this into a sidebar plugin by using the bundled 2.6.0 plugins as examples. It seems that the sidebars are components and have their own context so they may not be able to access &lt;span class="fix"&gt;@articles&lt;/span&gt; in the action context. I'll either have to query articles a second time, which I'm loathe to do, or write it in JS and then do a JS sidebar rendering. It would be nice if the sidebar shared or could access the primary context.&lt;/p&gt;

&lt;p&gt;UPDATE 2.1: After looking at &lt;span class="fix"&gt;layouts/default.rhtml&lt;/span&gt; I think it may be possible to pass &lt;span class="fix"&gt;@articles&lt;/span&gt; to the sidebar by adding it to:&lt;/p&gt;
&lt;pre&gt;&amp;lt;%= render_component(:controller=&gt;'sidebars/sidebar'&lt;/pre&gt; 
&lt;p&gt;&lt;span class="fix"&gt;default.rhtml&lt;/span&gt; gets &lt;span class="fix"&gt;@content_for_layout&lt;/span&gt;, not &lt;span class="fix"&gt;@articles&lt;/span&gt;, so some testing is needed.&lt;/p&gt;

&lt;p&gt;UPDATE 3: I was running the Lucid theme here before but I had problems with anchors in that articles and sidebar content above the selected anchor wouldn't render when an anchor was selected. I've switched back to Azure for now.&lt;/p&gt;</content>
  </entry>
  <entry>
    <author>
      <name>John Wang</name>
    </author>
    <id>urn:uuid:a2217cbb03931530e0c28989c859cc6e</id>
    <published>2006-06-04T11:12:00-05:00</published>
    <updated>2007-06-16T12:30:22-05:00</updated>
    <title type="html">ActiveRecord - Achilles Heel of Ruby on Rails?</title>
    <link href="http://www.dev411.com/blog/2006/06/04/activerecord-achilles-heel-of-ruby-on-rails" rel="alternate" type="text/html"/>
    <category term="activerecord" scheme="http://www.dev411.com/blog/tag/activerecord" label="activerecord"/>
    <category term="orm" scheme="http://www.dev411.com/blog/tag/orm" label="orm"/>
    <category term="rails" scheme="http://www.dev411.com/blog/tag/rails" label="rails"/>
    <summary type="html">&lt;p&gt;IMO, one of the major limitations of Ruby on Rails compared to other frameworks is its ORM, ActiveRecord. ActiveRecord is a fairly early ORM (object-relational mapper) that has made some questionable design decisions and doesn't support some very basic relational database concepts. These issues have been &lt;a href="http://discuss.joelonsoftware.com/default.asp?joel.3.309321.3"&gt;discussed on Joel on Software&lt;/a&gt; and elsewhere. Here are some limitations I wish were fixed:&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;IMO, one of the major limitations of Ruby on Rails compared to other frameworks is its ORM, ActiveRecord. ActiveRecord is a fairly early ORM (object-relational mapper) that has made some questionable design decisions and doesn't support some very basic relational database concepts. These issues have been &lt;a href="http://discuss.joelonsoftware.com/default.asp?joel.3.309321.3"&gt;discussed on Joel on Software&lt;/a&gt; and elsewhere. Here are some limitations I wish were fixed:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;strong&gt;No Foreign Key Support:&lt;/strong&gt; Although RoR lets you define has_many relationships, it makes no effort to create foreign key constraints in the underlying database to ensure relational integrity.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;No Multi-column Primary Key Support:&lt;/strong&gt; Multi-column primary keys are a staple of relational database schema definition. Unfortunately, &lt;a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/140320"&gt;DDH had a pretty simple response&lt;/a&gt;:
&lt;br /&gt;&lt;br /&gt;
&lt;em&gt;&amp;gt; Is there a way to set an ActiveRecord object to point to a table&lt;br /&gt;&amp;gt; with a multi-column primary key?
&lt;br /&gt;&lt;br /&gt;
Not really, no. Active Record was designed for a single column primary key and that assumption runs pretty deep. AR is not a Data Mapper, so you have to be within a reasonable vicinity of its
assumptions to enjoy it.&lt;br /&gt;- David Heinemeier Hansson&lt;/em&gt;&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;As DHH says in his multi-col PK response, you need to be close to ActiveRecord's assumptions, it doesn't cater to your situation. ActiveRecord is nice for many simpler situations but if you want relational integrity and/or have complex relationships, it seems like it may not be the best tool for the job. Other ORMs such as the Perl-based &lt;a href="http://search.cpan.org/~jrobinson/DBIx-Class-0.06003/lib/DBIx/Class.pm"&gt;DBIx::Class&lt;/a&gt; (often used with the &lt;a href="http://www.catalystframework.org"&gt;Catalyst framework&lt;/a&gt;) can handle these issues and many more. According to the 37Signals blog entry &lt;a href="http://www.37signals.com/svn/archives2/growing_in_vs_growing_out.php"&gt;Growing in vs. growing out&lt;/a&gt;, they prefer people to grow out of their applications. I'm curious if they also want people to grow out of ActiveRecord?&lt;/p&gt;</content>
  </entry>
</feed>

