Don't miss

I created an open source development tool to quickly & dynamically mock API endpoints. Check it out at GitHub: DuckRails

Heads up

I will no longer maintain arubystory. For new posts, find me at my personal blog. CU there!

Tuesday, December 1, 2015

Rails simple API application and a UI application consuming it

I recently created a simple Rails 4 API named LofoCats API and a simple UI application consuming it named LofoCats UI (yes, I like cats, what else is new?)

You can find the code for the:

The concept of the app is pretty simple: register & view lost or found cats

There are instructions on how to setup both apps in the projects' README.
The related tutorials will follow as soon as possible.


Saturday, October 3, 2015

Full Stack Overflow Developer

I'll talk a little about the way I think we should use all that information out there to do our "job".

Every now and then, we all visit to get some answers. Most of the cases can be categorised to the following:

  1. we don't know how to do something
  2. we get errors from the language/framework we use
  3. we get errors from the environment (OS, server etc)

Sunday, June 21, 2015

Being a developer

I can't really remember the first time I saw a computer. I do remember though that "working on a computer" was the first thing that came to my mind when I was asked "What do you want to do when you grow up?"

Years later, being both a grown up and a developer, I ask myself "Now that you know, if you were a kid again, would you still want to be working on computers when you grew up?". 

Let's see what a life for a developer means to me so far.

Tuesday, May 26, 2015

Ruby & Rails - Cool stuff & tips - S15E01

It's been a while since my last post, I didn't have the time to prepare a tutorial but I'm going to describe some stuff I thought they worth to be mentioned.

Arrays: map & each_with_index

I knew I could iterate through my array's items with an index of their position using the each_with_index method like this:
['a', 'b', 'c'].each_with_index do { |item, index|
  puts "#{index}-#{item}"

What is cool though, is the fact that you can use that index while mapping the elements to new objects. Here's how:
['a', 'b', 'c'] { |item, index|
  { :letter => item,
    :position => index }

Sunday, February 22, 2015

Creating the Hangman game

In this tutorial we are going to create Hangman, a simple game in which the players try to find a word that our application chooses, by selecting letters.

We will use:

Rails (version 4): you know what this is otherwise you are in the wrong place
Foundation: for the looks & feels
Font Awesome: for icons

Saturday, February 14, 2015

Radio buttons & required boolean attributes

Lately, I was trying to create a form for one of my models which had a required boolean attribute.

The model

class Foo < ActiveRecord::Base

  validates_presence_of :a_flag


Tuesday, October 28, 2014

Testing execution of a before_filter with RSpec custom matcher

UPDATE: I created my first gem to cover the functionality of this post. Visit its homepage here.

I was working on my application and I wanted to write some RSpec tests for some controllers having before_filter for some actions. I didn't want to explicitly test the behaviour of the filter since it was already tested in another context. I only wanted to test that it is being executed.

Tuesday, October 14, 2014

Rails - Rescue from memory leak

Lately, I've been trying to find possible memory leaks in a rails 3.2.x application.

NOT easy, believe me...

Anyway, after visiting almost every single result from googling "rails memory leak", I learned something I didn't know. Symbols in ruby never die.

Given that, I wrote some code to track the creation of symbols in the application by rendering a debugging kind of panel at the bottom of my application's layout which kept the previously generated symbols in an array and in each request, if new symbols where created, they were rendered as strings.

Sunday, December 22, 2013

Tutorial - Deploying the ToDo application to OpenShift - Ruby on Rails

In the previous three posts we created a simple ToDo application with Ruby on Rails. In this last part we are going to deploy the application to OpenShift. View the application deployed to Openshift.

Friday, December 20, 2013

Creating a simple ToDo application with Rails - Part Three - Devise & CanCan

This is the third part of the tutorial. In this part, we are going to use Devise & CanCan in order to add user authentication and authorisation features to the application.