Intertwingly on Rails
Views: index, post, comments, archives
This clearly is just modest beginnings. A snapshot of existing data. Read-only views at this point. No caching.
Technology is Rails 2.0.2 on SQLite3 using Phusion Passenger on Dreamhost.
Installation would have been a simple scp except for two issues: despite what it says in this list, the sqlite3-ruby gem does not appear to be installed. And the current date on the machine appears to be Feb 15, 3155.
For the model part, I can’t quite bear to break with the idea of flat files yet, so the model consists of two tables: posts and comments, and each contain dates and file name parts only. The remainder of the model is populated using an after_find hook from the flat files.
With my current Intertwingly, I had three views that had diverged over time, as well as a “partial” which contained the navigation bar. The front page (and comments page) are clean XHTML5, individual posts are XHTML1, and the archives are based a layout that I used back when I was on Radio Userland. In the Rails implementation, I have four views and a layout (index and comments becoming separate views). Having a common layout encourages consistency, and you can see the difference in the archive view already. More work needs to be done on the individual posts view.
The controller methods are positively pedestrian at this point. They simply obtain the necessary information from the model, and then proceed to render the associated view.
This is but a modest beginning... allowing people to enter new comments, openid, implementing spam avoidance measures, automated extraction of excerpts, ... the list goes on and on. But first, I plan to put this code under version control (probably git), and implement a test suite.