Subscribe to receive infrequent email updates from me with Ruby tips and gems.

When building a modern web application, a good practice is to think of your application as a set of services, independently of design and representation (UI). We can modularise an application and completely separate the front-end and back-end code. When separating these concerns, our complete web application can be developed in an API driven manner. In what follows, I will cover several advantages to following an API Driven Development (ADD) style.

Read on →

Internationalisation (or I18n) is a very interesting feature in Ruby on Rails. In this blog post, I will walk you through an implementation of internationalisation in a scaffolded Rails 4 application.

Read on →

As a freelancer, I have the opportunity to be working with a range of technologies such as Rails, Node.js, Redis and ElasticSearch. Lately, I’ve been working a lot with AngularJS and it has been one of the greatest technologies I’ve used in the last few years. I decided to blog about Angular because this framework deserves even wider recognition than it currently has. In this blog post, I will give a quick introduction to AngularJS. We will be building a few very small applications using Angular’s awesome double-data binding. In the future, you can expect other posts on modules, controllers, services, directives, form validation and more. Note that these posts are not necessarily comprehensive. For a comprehensive documentation overview, you can always rely on the official AngularJS API documentation.

Read on →

I am subscribed to quite a few email lists and every Saturday I free up a few hours to read through all emails I received past week. This week, I received a remarkably interesting email from Scott Britton with the following subject: “How to Chip Away At Your Long-Term Goals Every Single Day (Psst… Best Thing I’ve Done This Year)”. This seemed very interesting to me, especially since I get new ideas all the time. Usually, I just end up not working on them (due to bad planning, lack of time, or I just lose interest). To fix this problem, I will be following Scott’s approach. Let’s see if that makes me more effective.

Read on →

One month ago, I published my eBook on upgrading a Rails 3 application to Rails 4. The sales have been quite modest so far. At the time of writing, I’ve sold 63 books and have received a few positive reviews in my mailbox. In this blog post, I will share lessons learned on selling the first 50 books. Note that prior to writing this book, I had no online presence at all. So, as much as this post is about selling and marketing online content, it is also about how to create yourself an online presence.

Read on →

One of the questions I get from readers of my book (Upgrade to Rails 4) is about Live Streaming. Live Streaming sounds like a very exciting new feature, but quite a few people are confused about it. What are some of the applications of Live Streaming and more importantly, can it compete with Node.js?

Let’s walk through an implementation of a chatbox in both Rails and Node.js and see what we can learn about both implementations. Afterwards, we’ll run a few benchmarks to see which implementation is more efficient. I open-sourced both the Rails 4 Live Streaming Chatbox and the Node.js Chatbox implementation.

Read on →

Rails 4 is finally arriving! On the 25th of February, Rails 4.0beta 1 was released, and of course this is all very exciting. This version is already running in production on a number of applications, including Basecamp Breeze. By the way, Rails 4 will be huge. There are a ton of new features available, which make your life as a Rails developer a lot easier. In this post, I will talk about the most exciting features in Rails 4 and why you should be upgrading that Rails 3 app as soon as possible. By the way, you can find all of this information and a lot more in Upgrade to Rails 4, a book I’m writing.

Read on →

Yesterday, on the 24th of February, Ruby was exactly 20 years old. Even better, Ruby 2.0.0 was finally released! Hooray. In the next few blog posts, I’ll talk about some new exciting features and functionality in Ruby 2.0.0. In the meantime, here is how you can install the new version on a Mac using Homebrew. Note that you have to install libyaml, because Ruby 2.0.0 deprecated syck in favor of psych. Unlike Ruby 1.9.0, version 2.0.0 is a stable release, so it should be safe to upgrade now.

Read on →

Model IDs in your routes can be ugly and inefficient for SEO. In this blog post, I will show you how you can use slugs to make your URLs more descriptive of the page content. First, we will use a built-in solution (overriding the to_param method) to change the URLs and afterwards, we will use a gem called friendly_id to generate slugs and maintain a history of these slugs.

Read on →

Today, I will talk a little bit about operator overloading in Ruby. It’s a pretty cool concept. Operator overloading allows you to define how operators such as +, - and = will work on your own defined classes. Unfortunately, you cannot define completely new operators in Ruby. There is only a fixed set of recognized operators. Nonetheless, it’s a very powerful concept.

Read on →