Paul Sturgess

Hosting a ruby on rails blog on Heroku cloud hosting


over 7 years ago by Paul Sturgess on paulsturgess.co.uk articles.
I've taken the plunge and moved my site over to Heroku ruby cloud host. My initial impressions of the service are great so I thought I'd post up my experience...

Using rspec to test a named_scope in Ruby on Rails


over 7 years ago by Paul Sturgess on paulsturgess.co.uk articles.
When testing a named_scope it's important to test the expected behaviour of the method, not how it's implemented, as this will allow you to re-factor your...

Using Polymorphic urls and paths to create dynamic routes in Ruby on Rails


over 7 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Dynamic named routes in Ruby on Rails are really useful when you want to generate a url but you don't necessarily know which records it will be for. For...

Autocomplete text input using unobtrusive jQuery in Ruby on Rails


over 7 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Recently I needed to implement an autocomplete feature into a Ruby on Rails application so I thought I'd throw up the bare-bones of what I came up with...

Heroku H14 error (No Web Process running)


over 6 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Recently I had this problem even though heroku ps said everything was up and running and I had one web worker running. However, a quick turn it off and...

How to write a ruby gem


over 6 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Did you know you can use Bundler to create gems? This guide aptly named 'Developing a RubyGem using Bundler' is quite comprehensive and well worth a read...

ActiveRecord::StatementInvalid Mysql::Error: Duplicate entry in Ruby on Rails


over 6 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Sometimes users like to double click, sometimes requests just happen very, very, very close together. This can mean that Rails isn't quick enough to use...

How to remove a specific version of a gem file in a specific directory


over 6 years ago by Paul Sturgess on paulsturgess.co.uk articles.
First find the path of the gem... gem list -d "name_of_gem" Then to remove the gem... gem uninstall 'name_of_gem' -i '/path/to/gem'...

Ruby on Rails to_sym ArgumentError: interning empty string on startup


over 6 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Recently when I deployed a Rails application onto the staging server I got a Passenger error page telling me the application wouldn't start. The full error...

Autocomplete text input using unobtrusive jQuery in Ruby on Rails


over 6 years ago by Paul Sturgess on paulsturgess.co.uk articles.
Recently I needed to implement an autocomplete feature into a Ruby on Rails application so I thought I'd throw up the bare-bones of what I came up with...