has_many + scope + counter cache

I wrote this blog post partly for myself so I can have a reference for the future and also for other people who might jump into a similar problem and need a solution for it. In my current project I needed to display Users's Questions that have been answered by other users. My set up … Continue reading has_many + scope + counter cache

Advertisements

Scraping: Codewars Top 500 Users

Today I decided to practice my coding skills and took the time to solve one of the Kata challenges "Scraping: Codewars Top 500 Users". So here's my solution. Let me know your comments or thoughts. Note, that Codewars wanted a 1 based index array of Users. I have no clue why. I think this adds … Continue reading Scraping: Codewars Top 500 Users

Dynamically fading flash messages in Vue.js and VueX

We will be creating dynamcally fading flash messages with Vue.js and VueX. Let's say you want to display a flash message on a certain condition and you want that flash to show only for a couple of seconds and disappear afterwords. It is very easy to implement it yourself within a minute without any 3rd … Continue reading Dynamically fading flash messages in Vue.js and VueX

How to implement Rails params from the ground up in Ruby?

Hi guys! This time around I am going to show you how to implement Rails params completely from the ground up. As you probably already know, Rails has something called strong parameters. This is a security practice to prevent accidentally allowing users to update sensitive model attributes, for example "admin" flag in user model in … Continue reading How to implement Rails params from the ground up in Ruby?