Understanding and Using Ruby Rake

Something that you will see a lot in Ruby projects is Rake. Rake is a build tool for automating tasks. This means you can define a set of tasks that should be carried out as part of a build process, or perhaps a set of tasks that should be executed every time you run a […]

Continue reading...

Adding Validation to Ember Forms

Last week we looked at creating a new task in an Ember application. This involves accepting data from the form, creating a new task in Ember Data, and then saving the task, which will send a POST request to the server. A good API will validate incoming data to ensure that it is of the […]

Continue reading...

Creating new Ember Data objects

In last week’s tutorial we looked at transitioning to view an individual task. This involved writing a failing test and then incrementally implementing the functionality to make the test pass. So far in this mini-series we’ve created a task list, added task replies, and looked at viewing individual tasks. In today’s tutorial we will look […]

Continue reading...

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...