Tutorials

Introduction to Rails testing with RSpec and Capybara
I didn’t understand the importance of testing and used to think writing test was an extra effort (my app already work well when I wrote it, why should I spend extra time to write test for it?), boy I was so wrong 😅.Now I work in an enterprise hand...


How to GraphQL with Ruby, Rails,Active Record, and no N 1
You work on a mature web application that cleanly separates backend and frontend. The server-side code, written in Ruby, is mostly responsible for translating HTTP requests into SQL statements (with the help of an ORM) through rich and well-docume...


Create command line application with Ruby available via Homebrew
The goal of this article is to show you how you can create your command line application using the Ruby programming language and make it available.Our goal is to build a get_joke application that will render a random joke about Chuck Norris. The c...


How to Implement SSO System in Rails Using CAS Server
Single-Sign-On is a hot topic right now. Several applications such as Google, Facebook, and Github use it. Probably you’ve noticed on some pages a “Sign in with Google” or “Login with Facebook” button which enables a user to log in to a page witho...

Implementing Roles and Permissions in Ruby on Rails
A common requirement of web applications is the ability to specify roles and permissions.For example, many types of web application will have a distinction between admins and regular users. This can often be dealt with as a simple boolean on the u...

Migrate a Rails Project from Paperclip to ActiveStorage
Paperclip was an infamous gem in the Rails world which provided file upload capabilities for Rails projects. The gem was deprecated shortly after the release of Rails 5.2, which included a similar built-in capability known as ActiveStorage. This g...

Resize and optimise images on upload with ActiveStorage
This posts describes how to reduce the size of images uploaded with ActiveStorage significantly by combining a few optimisations.There are user uploads in the app for other things but the above are specifically for images. DynaBlogger is a Rails a...