Hi reader
Well, seeing as most of the traffic to this site seems to be from people looking for ideas on how to use Rails as a CMS I’ve got this basic pointer:
It’s pretty sexy. I’m in no way affiliated with the project – and that’s probably a good thing. If you want to get a CMS up and running quickly and be able to administer it with a minimum of fuss, this could very well be the thing for you.
On the other hand, if you’re still keen to see how far we can take this concept that Rails is effectively a language for describing a web site then my little project may be of interest. Fair warning.. it’s a bit odd, and might get suspended at any point if work or other pressures come to bear. With that in mind, let me introduce you to:
The Young Person’s Guide To Time Travel
Back in my uni days I started writing a novel. I don’t think that’s particularly unusual – many of us started writing a novel in uni. Some of us, like my old mate Penni Russon actually went on and got a novel published, but I chose to take a more traditional path and squash any idea of a successful career in writing under the rest of the pile of unrealised dreams and ambitions.
A while ago I blew the dust off a few old CD-ROMs and had a good look at my old writing. None of it was going to set the world on fire, but there was the odd spark – so I decided to give it another crack. Getting published is less of an issue as just getting something out there, so publishing online is an option. Since talking to Corey Doctorow at the Melbourne Writer’s Festival a few years back I’ve been interested in how the Creative Commons model provides a mechanism for writers to get their content out there without screwing their audience. I also want to live in a world where there’s a more direct dialogue between content creators and consumers. Apologies for (a) the implicit lefto-pinko-free-as-in-freedom sentiment and (b) name-dropping. For what it’s worth, I thought Corey was a decent guy.. though like many Canadians he has a funny-shaped head.
OK, enough of the back-story. Here are my basic requirements for a content management system:
- I don’t have time to learn a new tool.
Drupal, Radiant, etc may be great but it’s another “language” I have to grok. I understand and enjoy the conventions of Rails – that’s all I want to have to know. When it comes time to customise I don’t want to have to work around a different set of conventions or code.
- I don’t have time .. period.
I work full-time, have a family and a million other things in my life. The CMS needs to get out of my way and let me write. Anything clunky or complex is useless.
- The CMS must support my tool set.
The novel will get written in small increments, in a very ‘agile’ sense (release early, refactoring, etc). It’s very similar to how I might write code. I expect to be able to use text editors on my laptop, use version control systems, preview work locally, test it.. just like I would with an application. In my head, the novel is just a different kind of application.
Some of this was covered in the original ‘Ruby on Rails based CMS’ post from way back. I’ll be revisiting the points from that article as we go, though not right now. My immediate aim is just to get something up and running as quickly as possible – and the simplest thing I can possibly do is to create a new Rails app, create a controller for serving up pages and drop the opening page in.
You can see the code here:
http://github.com/ferrisoxide/guide_to_time_travel/tree/master
There’s plenty to do – I’ve been incredibly lazy and not bothered to secure or structure the code at all. That can come later. The objective was to get something live as quickly as possible. I nicked the Hemingway layout from Warpsire, though I’ll need to get it looking a bit neater. Getting the actual site up and running simply a matter of shelling in an running git clone. From go to whoa took maybe all of an hour, spread over a few days, with the first page available here:
One gotcha – Dreamhost’s Passenger setup doesn’t seem to use your local gems, so if you are wanting to use Rails 2.3.2 you need to install it into your local gem repo and run rake rails:freeze:gems. It’s quite odd, as rails -v will return the 2.3.2 version number if it’s installed but I’m guessing Passenger looks at the version of Rails in the official Dreamhost repo (v 2.2.2 at the time of writing). Makes sense.
All good. Now we come to the difficult part for all aspiring part-time novelists: the tricky second page. But that’s a whole new blog post. ‘Til next time…
Cheers Tom
