Our Blog.

Setting a default image when using Cloudinary and CarrierWave in Rails

Cloudinary lets you specify a default_image parameter when using the cl_image_tag, along with all of your transformations, to provide a fallback image if one has not been uploaded.  If, however, you are using CarrierWave, you’ll likely want to define your transformations and the fallback image just once in your Uploader class. The Cloudinary docs give loads Read More »

November 19, 2015 | by

Automatically restart struggling Heroku dynos using LogEntries

We have a Rails app hosted on Heroku which periodically develops a memory leak, pushing it well over Heroku’s per-dyno memory quote and slowing everything down as it hits swap. The issue is intermittent, random, and only happens every few days but it’s easy enough to deal with, just restart the dynos. However it has a Read More »

September 14, 2015 | by

Getting accurate code coverage metrics from SimpleCov in a Rails project

We use SimpleCov to track code coverage of our tests in Rails projects.  For coverage to be in any way useful as a metric it needs to be accurate.  We noticed that files for which we had no tests were not being tracked and not included in the coverage.  Therefore, our coverage metrics were artificially high and Read More »

June 18, 2015 | by

Preventing page redirects to data:, in Safari

Safari has a built in XSS auditor that tries to prevent reflective XSS attacks – where the attacker submits content through a POST request and it is immediately displayed back in the response.   To do this it looks for tags, including <script> and <iframe>, in the POST params.  If it finds any, it looks Read More »

May 22, 2015 | by

Limit the size of your Rails test and development logs

I just ran out of disk space and went looking for things to delete, I was amazed to find nearly 10Gb of test.log and development.log files kicking around. “Surely there must be a way to limit the size” I thought. There is!  And it’s easy.  And you should definitely do this now. In your config/environments/test.rb Read More »

April 23, 2015 | by

Using Pow with RVM 1.19’s .ruby-version and .ruby-gemset files

With the upgrade to RVM 1.19 you are asked to convert your old .rvmrc file into .ruby-version and .ruby-gemset files. You are using ‘.rvmrc’, it requires trusting, it is slower and it is not compatible with other ruby managers, you can switch to ‘.ruby-version’ using ‘rvm rvmrc to [.]ruby-version’ or ignore this warnings with ‘rvm Read More »

April 10, 2013 | by

Job: Full time Web Developer

Storm is a web development agency based in Bath, UK with a growing reputation.  To meet our ever increasing demand we’re looking for some new talent to join our skilled team. Role: Web Developer Basis: Full time Salary: Based on experience Location: Storm HQ, Bath, UK

February 26, 2013 | by

How to save the uploaded file name with carrierwave_direct and S3

So you’ve setup carrierwave_direct and you’re happily uploading files to Amazon S3. In this example I’ve mounted CarrierWave on a field called csv_file, but that can be whatever is appropriate to your app.   You’ve probably got two controller methods def upload @model = Model.new @model.save @uploader = @model.csv_file @uploader.success_action_callback = upload_successful_model_url(@model) end def upload_successful @model Read More »

January 17, 2013 | by

6 Ways to get More Bang for your Heroku Buck While Making Your Rails Site Super Snappy

We love Heroku. It makes deployment so easy and quick. However, it can start to get pricey when you add additional dynos at $35 each a month. With a small amount of work, you can get a lot more out of your Heroku hosting whilst drastically improving the performance of your site. You might need Read More »

December 11, 2012 | by

Using tomdoc to document a scope in a Rails model

I’m playing around with Tomdoc for documenting my latest Rails project.  The documentation is (ironically) a bit thin on the ground.  It’s taking a bit of trial and error to get some things working.  The most recent brainteaser was how to get tomdoc (or even rdoc) to document a scope declared on a Rails model.

November 28, 2012 | by