Using blank and compact in Ruby on Rails to help output incomplete data


almost 11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Often I want to display a set of address fields, but only show the ones that have been filled in by the user. For example if I have an Applicant with several...

How to display the file name of an upload in Ruby on Rails


almost 11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Often you want to display just the filename of an upload/attachment that a user has uploaded. Just do the following: File.basename(@vacancy.document) The...

New host, new look and feel, new functionality


almost 11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
New look and feel Just in time for the new year and a new look site. I've refreshed the design, keeping to the same colours but changing the layout slightly...

Application Waiting For Purpose


almost 11 years ago by Manfred on Operation0.org posts.
While I was busy writing my (Poignant) Guide to Ruby… wait… no that’s Why’s excuse. The point is that Sir Lemon (of the Raspberry...

How to automatically pluralize text in Ruby on Rails


almost 11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
To automatically pluralize a word in Ruby on Rails you just neeed to do the following: So you just pass the method a number and the singular word or...

Building Less and Bouncing Off Cushions


almost 11 years ago by Manfred on Operation0.org posts.
Rodney, Bringer of Smalltalk Books, has set up his company’s blog on Cushion. In his first post he explains that 50% of the people working at the...

The Stamping Feet of Elephants


almost 11 years ago by Manfred on Operation0.org posts.
I consume vast amounts of media on the web, and now it’s time to give back. Give back like an elephant that has been insulted. Like a hood rat to...

Seen in the Camping Pound


almost 11 years ago by Manfred on Operation0.org posts.
manfred-s - Camping, the most tightly over much of ruby ever produced Asztal - Camping: waffles waffles waffles waffles waffles waffles lucas - Camping...

Simple Page Caching With Hidden Carrots


almost 11 years ago by Manfred on Operation0.org posts.
Don’t bother looking for carrots, we’re just going to talk about caching in Camping. In the perfect world we would let the webserver serve...

How to specify multiple layouts within the same controller in Ruby on Rails


~11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Using more than one layout in a controller is as simple as placing the following code in your controller: layout :choose_layout private def choose_layout...