Using SagePay on AWS

Sagepay bloc.content

SagePay’s Direct Integration method requires you to give them a list of ‘valid IP addresses’ - what are you supposed to do when your site is hosted in the cloud in a load balanced environment where IP addresses are automatically assigned?

Read Post

Engine Routes

Rails routes.content

Recently I've been modularising a Rails app via the use on Engines and came across a scenario for which there (doesn't seem) to be much written about, using url/path helpers outside of constraints.

Read Post

Cloudfront + Nginx


Cloudfront and Nginx need a couple of settings to work nicely together, coupled with Rails asset pre-compilation and .gz generation your left with a server thats doing a lot less work.

Read Post

Polymorphic Multiple Source Type Through.. What?!


Given a scenario where a resource (say a video, a blog post) can belong to multiple categories it would make sense to create a model called 'ResourceCategory' that just has 'belongs_to :category' and 'belongs_to :resource, polymorphic: true', then add 'has_many :resource_categories, :source => :category' to your 'Category' model, however because the resource association is Polymorphic you can't return a collection without specifying a type.

Read Post

Mina Deployment on a Multi-Site Rails Server

Mina post.content

I've been using Mina (mina-deploy/mina) to automate the deployment of sites and updates to sites under a multi-site server setup that I've created to run smaller Rails sites for a low cost that allows me to use Rails even on smaller jobs.

Read Post