Advisory locking with ActiveRecord

Not too long ago we had a problem with doing (almost) guaranteed inserts for columns with unique constraints on them (see this post). Today I was facing a…

Building Rails 3 custom validators

Actually this post is not so much about just building custom validators for Rails 3 but more like a in-depth introduction to how validations work in the old…

Unobtrusive custom confirmation dialogs with jQuery

I need confirmation dialogs, I need them to be dynamic, unobtrusive, custom styled and flexible. Most of the conditions rule out the built-in [cc lang="javascript" inline="true"]confirm()[/cc] function in Javascript. So I decided to build my own with jQuery and share the basic ideas behind the solution.

Ruby on Rails before_render filter

You probably have used, or at least seen, ActionController::Filters used in lots of Ruby on Rails based applications. Usually it’s related to some authentication/authorization, or benchmarking or something…