<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hackdiary &#187; rails</title>
	<atom:link href="http://www.hackdiary.com/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackdiary.com</link>
	<description></description>
	<lastBuildDate>Wed, 10 Feb 2010 13:34:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using Omnigraffle to visualise Rails model associations</title>
		<link>http://www.hackdiary.com/2006/08/02/using-omnigraffle-to-visualise-rails-model-associations/</link>
		<comments>http://www.hackdiary.com/2006/08/02/using-omnigraffle-to-visualise-rails-model-associations/#comments</comments>
		<pubDate>Wed, 02 Aug 2006 14:57:19 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=93</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;m doing some Rails consulting work for a company that&#8217;s already developed and deployed a major application. Getting to know a new codebase takes a little time and every diagram or visualisation helps. To help me understand their ActiveRecord model relationships, I knocked together a quick script to scan the associations between models and output it in the <a href="http://www.graphviz.org/">Graphviz</a> DOT format.</p>
<p><span id="more-93"></span><br />
A quick Omnigraffle import later, and I get useful diagrams like this fragment from the <a href="http://www.hackdiary.com/archives/000081.html">BBC Programme Catalogue</a> codebase:</p>
<p><img src="http://www.hackdiary.com/images/bbc_models.png" /></p>
<p>Here&#8217;s the code, ready for running from the top of any Rails project (ymmv, etc):</p>
<pre class="codeblock">
#!/usr/bin/env ruby
require "config/environment"
Dir.glob("app/models/*rb") { |f|
require f
}
puts "digraph x {"
Dir.glob("app/models/*rb") { |f|
f.match(/\/([a-z_]+).rb/)
classname = $1.camelize
klass = Kernel.const_get classname
if klass.superclass == ActiveRecord::Base
puts classname
klass.reflect_on_all_associations.each { |a|
puts classname + " -> " + a.name.to_s.camelize.singularize + " [label="+a.macro.to_s+"]"
}
end
}
puts "}"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2006/08/02/using-omnigraffle-to-visualise-rails-model-associations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BBC Programme Catalogue is live</title>
		<link>http://www.hackdiary.com/2006/04/26/bbc-programme-catalogue-is-live/</link>
		<comments>http://www.hackdiary.com/2006/04/26/bbc-programme-catalogue-is-live/#comments</comments>
		<pubDate>Wed, 26 Apr 2006 14:00:00 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=82</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve returned to the working world from <a href="http://www.hackdiary.com/archives/000075.html">sabbatical</a> and now it&#8217;s a big day. I&#8217;ve been looking forward to this all year.</p>
<p>This afternoon I flipped the switch on the <a href="http://open.bbc.co.uk/catalogue">BBC Programme Catalogue</a> and let everyone in. Stop reading this now and get in there.</p>
<p><span id="more-82"></span><br />
I&#8217;m going to have a fun afternoon monitoring the server for load, but I know that lots of people are going to have a great deal more fun looking through the catalogue. The depth and quality of this unique library of information is quite stunning. It gets better every day, as it receives nightly updates from the master database inside the BBC. I was particularly pleased to discover that even <a href="http://open.bbc.co.uk/catalogue/infax/contributor/1126966">my dad</a> has a listing: he appeared on the local news as a council spokesman during the UK <a href="http://open.bbc.co.uk/catalogue/infax/tag/bans_on_beef">BSE crisis</a>. As one of our early-access guinea pigs said, &#8220;this is as addictive as Google Earth for anyone interested in UK television and radio.&#8221;</p>
<p>If you&#8217;re interested in the technical details behind the site, I&#8217;ll be speaking at the <a href="http://railsconf.org">RailsConf</a> and <a href="http://xtech.org">XTech</a> conferences later this year about how Ruby on Rails made this one of the smoothest software development projects I&#8217;ve ever worked on. I doff my cap to my co-conspirators: <a href="http://www.tomski.com/">Tom Loosemore</a>, Julie Rowbotham, <a href="http://www.benhammersley.com">Ben Hammersley</a>, Adam Lee, and the wonderful librarians and techies who toil ceaselessly in the BBC&#8217;s archive.</p>
<p><a href="mailto:mb@hackdiary.com">Let me know</a> what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2006/04/26/bbc-programme-catalogue-is-live/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>London Web Frameworks night was great</title>
		<link>http://www.hackdiary.com/2005/11/18/london-web-frameworks-night-was-great/</link>
		<comments>http://www.hackdiary.com/2005/11/18/london-web-frameworks-night-was-great/#comments</comments>
		<pubDate>Fri, 18 Nov 2005 13:47:00 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=74</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>I had a great time presenting yesterday evening at the London Web Frameworks night. Huge round of applause to <a href="http://blog.unixdaemon.net/cgi-bin/blosxom.pl/events/frameworks_200511_done.html">Dean Wilson</a> for putting it together. I learnt interesting things about Catalyst and Django from the other speakers, and did my first public demo of the <a href="http://www.hackdiary.com/archives/000071.html">BBC Programme Catalogue</a>. I&#8217;m immensely proud of the site, and I think it came across.</p>
<p><span id="more-74"></span><br />
I had a great blessing from the demo gods. Simon Willison had borrowed my laptop for his talk. I was just about to demonstrate a search I&#8217;d pre-planned, but Firefox autocompleted my typing with &#8216;appleseed&#8217;, a term Simon had used to demonstrate local band search on <a href="http://www.lawrence.com/bands/the_appleseed_cast/">lawrence.com</a>. I took a deep breath and just hit &#8216;search&#8217;. The BBC archivists didn&#8217;t let me down &#8211; we found &#8220;A SERVICE FOR SCHOOLS, JOHNNY APPLESEED SUMMER 1981&#8243; that was broadcast nearly 25 years ago on Radio 4. I went on from there to show what else had been archived from that day in 1981, demonstrate other searches and show off the full FOAF and RSS feeds for every item.</p>
<p>For completeness, I&#8217;ve posted the <a href="http://www.hackdiary.com/slides/wf2005/">slides</a>, which are done in <a href="http://www.meyerweb.com/eric/tools/s5/">S5</a> as usual. However, I&#8217;ve been reading <a href="http://www.presentationzen.com/">Presentation Zen</a> recently and they don&#8217;t really stand up by themselves. I&#8217;ve really gone off bullet points, and I find that if I use them then I read off my slides rather than talking to the audience. Oh, and I only tested the CSS on Firefox/Mac. They did look quite <a href="http://www.flickr.com/photos/duncanponting/64442607/in/set-1391629/">pretty</a> on the night, I reckon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2005/11/18/london-web-frameworks-night-was-great/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REST On Rails</title>
		<link>http://www.hackdiary.com/2005/11/03/rest-on-rails/</link>
		<comments>http://www.hackdiary.com/2005/11/03/rest-on-rails/#comments</comments>
		<pubDate>Thu, 03 Nov 2005 10:18:45 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=73</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>XML.com have just published an article I wrote for them last month entitled <a href="http://www.xml.com/pub/a/2005/11/02/rest-on-rails.html">REST On Rails</a>.</p>
<p><span id="more-73"></span><br />
It outlines one approach that I&#8217;ve been developing for the API in the BBC programme catalogue. One of the things I like a great deal about Rails is its URL routing and dispatch mechanism. Creating mappings from URLs to model instances makes a resource-oriented style feel very natural, which sits very well with REST.</p>
<p>Isn&#8217;t this a wonderfully literal interpretation of the article&#8217;s title?</p>
<p><img src="http://www.hackdiary.com/images/111-rest_on_rails.gif" alt='REST on Rails' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2005/11/03/rest-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The BBC&#8217;s programme catalogue (on Rails)</title>
		<link>http://www.hackdiary.com/2005/10/31/the-bbcs-programme-catalogue-on-rails/</link>
		<comments>http://www.hackdiary.com/2005/10/31/the-bbcs-programme-catalogue-on-rails/#comments</comments>
		<pubDate>Mon, 31 Oct 2005 19:00:00 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=72</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><b>UPDATE: The BBC Programme Catalogue has launched at <a href="http://open.bbc.co.uk/catalogue/infax">http://open.bbc.co.uk/catalogue/infax</a></b></p>
<p><i>&#8220;The BBC plans to open up its archive to make a treasure trove of material available to everyone.&#8221;</i> &#8211; <a href="http://www.bbc.co.uk/pressoffice/pressreleases/stories/2003/08_august/24/dyke_dunn_lecture.shtml">BBC Press Release, August 2003</a></p>
<p>Ever wondered what&#8217;s in that archive? Who looks after it? It turns out there&#8217;s a huge database that&#8217;s been carefully tended by a gang of crack BBC librarians for decades. Nearly a million programmes are catalogued, with descriptions, contributor details and annotations drawn from a wonderfully detailed controlled vocabulary.</p>
<p>I&#8217;m the lucky developer who gets to turn this hidden treasure into a public website. No programme downloads yet, but a massive searchable programme catalogue.</p>
<p><span id="more-72"></span><br />
In the early part of next year, you can look forward to a public beta with extensive programme details and broadcast histories. There are &#8220;On This Day&#8221; schedules that go back to 1933. It&#8217;s got full contributor histories, and Really Good Search. I can&#8217;t begin to describe the depth of this dataset &#8211; it had an entry for the one time in the 1990s when my dad was on local TV news as a spokesman for Oxfordshire County Council. The cataloguers have worked hard on this stuff for years, and it deserves a wide audience.</p>
<p>Here are some early screenshots: <a href="http://www.hackdiary.com/images/peel-search.png">searching for John Peel</a>; <a href="http://www.hackdiary.com/images/peel-contrib.png">John Peel&#8217;s contributor page</a>. The design&#8217;s not finished yet, but they give you a flavour of the data.</p>
<p>Oh yes, there&#8217;s also plenty of web 2.0 goodness: Ajax, feeds for everything, tags, full read-only REST API including FOAF for all contributors, and it&#8217;s all run with Ruby on Rails. Yes, the BBC have allowed me (after some persuasion) to rapidly prototype and deploy this 7,000,000-row database-backed site in everyone&#8217;s new favourite web framework. This first version is really just a prototype; wisely, the BBC have decided to get it out there quick and see the public reaction.</p>
<p>We&#8217;ve got <a href="http://www.benhammersley.com/weblog/2005/10/31/hot_bbc_archive_action.html">Ben Hammersley</a> on board working on layout, CSS and feed design. <a href="http://www.minty.org/">Murray Walker</a> is our BBC developer on the inside. This is the most fun I&#8217;ve had on a project for a long time. If you want to hear more about it, come and see me talk on Rails at the <a href="http://blog.unixdaemon.net/cgi-bin/blosxom.pl/events/frameworks_night_short.html">London Web Frameworks Night</a> in November. If you&#8217;ve got ideas on how you&#8217;d want to track down an obscure sci-fi drama from the 80s or a radio play from 1962, <a href="mailto:matt@hackdiary.com">drop me a mail</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2005/10/31/the-bbcs-programme-catalogue-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
