Using Ruby Exceptions

When developing an application, it’s easy to just think about the happy path. The happy path is the flow through the application when everything works as expected. The user enters the correct data, the request satisfies the business logic and any interaction with third party services or infrastructure happens without a hitch. In reality, there […]

Continue reading...

Transitioning to new pages in Ember

Over the last couple of weeks we’ve built out the main task list using TDD. First we built out the task list using static HTML (Writing your first Ember.js Acceptance Test). Next, we made it dynamic by returning data from the Controller (Introducing Controllers and Models to an Ember.js Application). Next, we mocked an API […]

Continue reading...

Adding related models to an Ember Application

Last week we introduced Ember CLI Mirage to mock the API server. By mocking the API server it means we can effectively work with the Ember application in isolation during development and testing. When it comes to shipping the application to production, we can just switch out the mock for the real server. Last week […]

Continue reading...

Working with Mixins in Ruby

Over the last couple of weeks we’ve looked at a couple of important concepts when working with Classes in Ruby such as Inheritance and using Modules. Ruby is a programming language that only allows single inheritance. This means a class can only inherit from one parent class. However, there are a lot of situations where […]

Continue reading...

Mocking your JSON API with Ember CLI Mirage

Last week we went from static HTML to calling a property on the controller to retrieve data for an Ember template. We also created a very simple model object so that we could get the title attribute and display it on the page. However, in the real world you would never hard code your data […]

Continue reading...

Creating and using Modules in Ruby

A problem that you will encounter when you begin to work on bigger Ruby projects is code organisation and how best to reuse code. Modules are a way of “namespacing” your code. This is important for organisation, but it also prevents name clashes between classes, methods and constants. In today’s tutorial we’ll be looking at […]

Continue reading...

Understanding Inheritance in Ruby

One of the fundamental aspects of Object-oriented programming is inheritance. Inheritance is where an object inherits from another object. This means it acquires the same properties and methods of it’s parent. This is an important concept for a lot of reasons. However, I think inheritance is often misused by newbie programmers who jump at the […]

Continue reading...

Writing your first Ember.js Acceptance Test

Last week I set the foundation for a new little mini-series here on Culttt all about building an Ember.js application using Test Driven Development. Previously we’ve covered a lot of the basics when it comes to getting to grips with Ember. However, I feel learning how to write tests should really be through Test Driven […]

Continue reading...

What is Monkey Patching in Ruby?

One of the most powerful aspects of Ruby is the ability to re-open any class and change it’s methods. Yes that’s right, you can actually reopen any class and change how it works. This includes the standard Ruby classes like String, Array or Hash! Now this is obviously as dangerous as it sounds. Being able […]

Continue reading...