Building a Shopping Cart in Ruby on Rails (Part 2)

In the previous part I showed you how to create a cart, add products to it and how to keep products in user's cart so they can leave the session and come back at a later time and their products will still be in their cart. In this part I will show you how to … Continue reading Building a Shopping Cart in Ruby on Rails (Part 2)

Advertisements

My first Service Objects in Ruby on Rails

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

Building a Shopping Cart in Ruby on Rails (Part 1)

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)

Find and collect map, select, inject and zip – useful Ruby methods

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