Tag Archives: ruby

Rails javascript specific layout

Recently I’ve started to favour using small snippets of js.erb for each controller action over using one monolithic javascript controller designed to run the whole application. It means you have small manageable pieces of code which are only loaded when … Continue reading

Posted in Development, Ruby / Rails | Tagged , , , | 1 Comment

The Battery Guys, Number 1 for car batteries

I was pretty chuffed to find that after over a year of optimisation, hard work and good service one of my favourite clients thebatteryguys.co.uk have reached the top of googles search results for the term “car batteries” and are second … Continue reading

Posted in Clients, Development, SEO | Tagged , , , , | Leave a comment

Acts As State Machine error handling

What is it? Acts as state machine (AASM) is a rubygem for adding finite state machines to Ruby classes. http://github.com/rubyist/aasm. This is a widely used gem/plugin and is the de-facto standard for state management in Ruby on Rails. Whilst working … Continue reading

Posted in Development, Ruby / Rails | Tagged , , , , | Leave a comment

Unobtrusive javascript with Rails 2.3.5

This is my handy little bit of javascript to make it easier to do UJS in Rails 2.3.5. Create a file within your public/javascripts folder called ajax.js containing the following: //unobtrusive javascript replacements //setup for format.js block $.ajaxSetup({ ‘beforeSend’: function(xhr) … Continue reading

Posted in Development, Javascript | Tagged , , , , , | Leave a comment