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 Adam Pope
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 Adam Pope
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 Adam Pope
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 Paul Leader
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 Adam Pope
Rails caching: expiration silently fails when called from the console or rake tasks
I have an application where a lot of work gets done behind the scenes by worker processes, scripts and rake tasks. I have a sweeper for one of my models to clear out some caches that can’t be cleared automatically using DHH’s key-based expiration technique. The cache keys in this use case are simple strings.
November 7, 2012 | by Paul Leader
Ruby on Rails: How to open the source for a ruby gem easily using bundler
No matter how good the documentation for a Ruby gem might be, from time to time you’ll probably need to dig around in the code to check or confirm exactly what it does, or what options it might take.
May 1, 2012 | by Paul Leader
Ruby on Rails gotcha: updating child records with callbacks and nested attributes
I recently ran into a bit of a gotcha concerning the way nested records get updated in Rails, which in hindsight makes total sense, but caused some confusion at the time.
April 25, 2012 | by Paul Leader
Generating PDFs in Rails with PDFKit and deploying to a server
I’ve been using the rather excellent PDFKit library on a recent Ruby on Rails project to generate PDF reports. The API is perfect: have some HTML, give me a PDF back.
April 23, 2012 | by Adam Pope
ActionMailer link for a Rails app deployed in a sub-directory
I’ve just deployed a Ruby on Rails application in a sub-directory of a client’s website. So rather than accessing the app at www.example.com, you need to visit www.example.com/app. This was quite easy using an extra couple of lines in config.ru.
April 18, 2012 | by Adam Pope