a work on process

Greenbelt photo from flickrFor this year’s Greenbelt a group of us decided it was time to beef up the festival’s ’social media’ output. With approval from the powers-that-be, the help of some phones from Nokia and the energy that comes from a festival’s buzz, we built up a twitter community, streamed plenty of content live to qik, and enjoyed the fact that the festival’s flickr presence now has a momentum all its own (the official photos had over 100,000 views in the past week and there are over 3600 photos tagged greenbelt2008 as I write this).

One of the perennial questions facing those planning the festival’s online presence is what audience there is when 20,000 of those most committed to the event gather together for a weekend of camping. During the ten years the event’s been at its current site we’ve gradually extended the wifi coverage to more and more of the site, but it’s still far from comprehensive and largely provided just for those who are helping make the festival run rather than available to all. Times are changing as more and more of us have access to EDGE and 3G from our mobiles, but power outlets are in short supply and its not yet possible to get through four days of intensive use without charging up your phone.

Using twitter was a simple decision, though the timing was poor as they turned off their UK SMS service just days before the festival, so it became much less effective as an on-site co-ordination tool. Nevertheless, the greenbelt twitter account continues to pick up followers (its existence seems to have introduced a number of new people to twitter, judging by the number of people for whom it was the first twitter account they followed) and we’re excited to see how it can be used over the course of the year to sustain and build the festival’s disparate community.

Thanks to WOM World/Nokia we had a set of N82s (and one N95) to experiment with qik and between Steve Lawson, Lobelia, Mike Radcliffe and myself we produced several hours of video content, largely streamed live. As time was tight, we focussed primarily on our personal networks for promotion and a qik group to collect it. During the festival the videos had around 3,000 views and the total is now up over 6,000, which didn’t seem at all bad with so little promotion. More than that, there’s been some great feedback suggesting that the quality of engagement is high.

Perhaps the most exciting part of the project was the response from those we were filming and interviewing. So many people were happy to stop for an interview and were fascinated by the technology and the possibilities, particularly the fact that with qik we could get live feedback on the filming and, though we didn’t use it to its full potential, adapt the content based on that feedback.

There are lots of lessons to be learned, and I’m just getting started on wrapping my mind around it so that we can refocus for next year and transmit that knowledge more widely. Naturally, the rest of the thoughts will appear here as soon as they’re ready. And of course, keep an eye on the twitter feed for news from Greenbelt.

(photo above courtesy of the greenbelt flickr stream)

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

Announcing image_associations

20 August 2008 (8:06 am)

By James Stewart
Filed under: Announcements
Tagged: , , ,

Discussions of multi-model forms and nested models in Rails has been revived recently, with various changes appearing in Edge Rails, plugins like attribute_fu getting a lot of attention, and the release of ActivePresenter. It looks like when the dust settles we’ll have a nice new set of ways to simplify our code.

One thing I frequently find myself doing is associating multiple images with a given model. My news story might have a banner image, and a series of other attachments, which I could specify with:

class Story < ActiveRecord::Base
  belongs_to :banner_image
  has_many :story_attachments
end
 
class BannerImage < ActiveRecord::Base
  has_attachment # I'm using attachment_fu
end
 
class StoryAttachment < ActiveRecord::Base
  has_attachment # I'm using attachment_fu
end

(or I could use has_one in place of belongs_to there, your tastes/requirements may vary)

What quickly becomes a pain is assigning the images to the models, and having rejected fat controllers I often end up writing accessors on my models to manage that for me:

class Story < ActiveRecord::Base
  belongs_to :banner_image
  has_many :story_attachments
 
  def banner_image(data)
    if valid_file?(data)
      self.banner_image = BannerImage.create(:uploaded_data => data)
    end
  end
 
  def valid_file?
    # etc.
  end
end

That quickly gets dull, so I’ve wrapped it up in a plugin I’m calling image_associations. With that I can write:

class Story < ActiveRecord::Base
  belongs_to_image :banner_image
  has_many_images :story_attachments
end

and get the accessors for free.

It may only be of use to me, and it’s pretty crude (there’s no support for deleting attachments, for example) but it’s been working nicely and has DRYed up my code in a satisfying way, so I thought I’d throw it out there. You can find it over on github.

(I’m not promising to keep supporting it, but it is used in an active project so chances are bug fixes will make it in. And of course, anyone is welcome to branch the project and twist it in their own ways)

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

Massive interest in Ruby on Rails over the past few years was quickly mirrored in book sales. Early entrants like the (near definitive) Agile Web Development with Ruby on Rails were break away hits in a world that usually sees modest sales of each title. It’s not surprising a lot of people wanted to get a share of that market, and the range of Ruby and Rails titles has exploded, with an unsurprising dip in average quality.

This latest title from Packt sits somewhere very low down the quality scale. An unfocussed volume, it purports to introduce the ruby language and show how to get up and running with a simple buzzword-laden Rails application, but does a distinctly inadequate job on both counts. Any moderately experienced rubyist would worry at seeing code like:

class Tale
  @author
  @genre
  @tale_body
end

recommended as the way to define a class with three attributes, rather than the more succinct, idiomatic and functional:

class Tale
  attr_accessor :author, :genre, :tale_body
end

(For those unfamiliar with ruby, the former will define attributes but not accessors for them. The latter will define the attributes and its accessors and is the recommended approach for public attributes)

That example occurs early on, and as the book progresses it is hard to shake the sense that the author isn’t sufficiently familiar with the idioms and best practices of the Ruby and Rails communities to be introducing either the language or the framework. When working with a framework as dependent on conventions and opinions as Rails, a failure to grasp the idioms is a serious problem.

It would be hard to recommend this book even if there weren’t many superior titles available. Newcomers to Ruby and/or Rails would be far better with any of several alternatives. Beyond that, while packt have published a number of excellent titles, the publication of this book should be taken as a reminder that there is no consistent quality control over the books they publish and buyers should research carefully before buying one.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at packt, amazon US, amazon UK and all sorts of other places.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]