I am learning how to keep my controllers clean as they grow while I develop. I am also trying to make my controllers handle only the HHTP-related stuff and move any other logic outside of it to make it read better and optimize it. As I understand it, a Service Object implements all kind of … Continue reading My first Service Objects in Ruby on Rails
This blog post covers basic concepts of testing Rails applications. After reading this post, you will know: Why we should write tests Testing 'philosophies' Types of tests How to write unit and integration tests for your application. Why do you test it all? The 4 things that we are looking for in tests are: Catching … Continue reading Testing Rails Applications
On my Ruby on Rails course I was tasked to build an e-commerce web application. In this post, I’ll cover creating a shopping cart that will keep track of products and their quantity and allow users to remove items. The full list of requirements was this: display a list of products to the client client can … Continue reading Building a Shopping Cart in Ruby on Rails (Part 1)
Today I would like to share with you some methods I have learned in Ruby. They are very cool and help a lot in resolving complex problems. #map and #map! #map and #map! transform elements of an array. In my example, it iterates over each element of my_array and multiplies it by 2 and returns a … Continue reading Find and collect map, select, inject and zip – useful Ruby methods
Today I learned something really usefull. I learned that validations of models in Ruby on Rails is no 'magick', as I used to think. Thanks to Andrzej Krzywda from Arkency I learned how this all works and where this all comes from. First, I visited rails'es github and took a look at the actual rails … Continue reading Unveiling ‘magick’ of Ruby on Rails validations
Today I wrote a program that calculates when someone has lived 10*9 seconds. For me it was 12-12-2014 01:46:40 🙂
How to deploy a Rails app to Heroku? I started off the first week by creating a simple 'Hello World' application and deploying it to Git. Another thing I wanted to learn was to deploy an application to production so everyone can actually see it in the itnernet. I wanted to learn how to deploy … Continue reading How to deploy a Rails app to Heroku?