Time Management: how you can use your time in an efficient way

Time Management: how you can use your time in an efficient way

Did you never ask yourself if there is something that can really change your way of working? Do you think that something can really have a big impact in your life?Something that is really important to do? We are often not so focused on our real target and we let that the everyday emergencies lead our working life and finally we see  that we didn’t reach big results or in the ...

Read more

Rails Best Practices 2: Move logic to model

Today we continue our analysis of the Rails Best Practices. In the previous post we saw Named Scope, Model Association and Following the same direction, in today’s post we’ll examine the use of Callback Model and Virtual Attribute.1. Virtual AttributeSuppose we have a customers list table defined as follows123456create_table "clients", :for...

Read more

Rails Best Practices 1: Fat Model – Skinny Controller

Maintain a skinny controller is one of the most important things to increase the readability and testability of the code. Let’s see some practices to move from the logic controller to the model.1. Named ScopeIn this first example we see how to use a named_scope to move the research methods in the model, simplifying the controller.Suppose you have a controller where in the index method we extract the list of sedan cars and...

Read more

Rails Best Practices: introduction

I’ve decided to dedicate a series of posts to Rails Best Practices because I think it is important to share in order to continuously improve the way you write programs.Write these posts will also be an opportunity for me to investigate my knowledge, so I invite you right now to follow this trip with me and contribute with your comments.This first post is just an introduction in which I want to highlight the advantages of writing Ruby on Rails applications following the Best Practic...

Read more