Skip to content

Monthly Archives: December 2007

has_wiki_field: quickly building a wiki in Ruby on Rails

Has the boss just discovered wikis? Does he now want to be able to create links between records in your intranet applications? Need to quickly add wiki functionality to your models and views so you can get back on with your life? That’s what happened to me recently. Since the wiki code was almost exactly [...]

Generating an iCalendar feed from a controller in Ruby on Rails

Recently I needed to set-up an application to keep track of regular safety inspections for power tools and other equipment. The application is very trivial but my client was quite pleased with one particular feature which wasn’t actually requested. The “bonus” feature was an iCalendar feed which allows the client to have his computers subscribe [...]

Easy filtering by optional criteria in Rails applications

I’ve frequently needed a very simple search method that allows partial matches for any combination of fields in a table. The following snippet shows how an ActiveRecord derived object might have a filter to allow for selection of records given a set of partial values. class YourClass < ActiveRecord::Base def self.filter( partial_values ) # don’t [...]