Rails counter cache

Let's say you have an application similar to Twitter where you have Users and Tweets and User 'has_many' tweets and Tweet 'belongs_to' user and you want to display how many Tweets a User has or how many people follow his Tweets. Typically, what you would do is query users and count their Tweets in by … Continue reading Rails counter cache


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)