How to check if a file exists in Ruby on Rails


~11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Sometimes file uploads can go wrong; rather than risk your Rails app falling over, it makes sense to check if the file actually exists. Your database might...

How to output a boolean true or false to display yes or no in Ruby on Rails


~11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
So you have a boolean check in your database and you want to convert the output from saying "true" or "false" to something more readable like "yes" or ...

How to truncate text in Ruby on Rails


~11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
It's really simple to truncate text in Rails, just pass the function the text, the max number of characters you want to show and a truncate string you want...

Wrong number of arguments (2 for 1) Ruby on Rails error


~11 years ago by Paul Sturgess on paulsturgess.co.uk articles.
The best way for me to explain how I solved my Wrong number of arguments (2 for 1) error in Rails is by example. Basically I wanted to find all my departments...

Capistrano-Standing Room Only


~11 years ago by PragDave on PragDave.
It was standing-room only at Mike Clark's Capistrano talk: one of the first talks at this year's RailsConf. Latecomers stole chairs from other rooms...

Glue That Doesn't Set


~11 years ago by PragDave on PragDave.
Back in the old days of computing—those days where I could still see my knees when standing up—folks used to talk about languages such...