Action Text - Handling file attachments (Audio / Video / PDF) in Rails 6

Action Text is a very powerful rails feature which uses Trix editor from basecamp under the hood, In this article we will understand how to use ActionText to work with different media format.

Let's create a new Blog Application for this demo.

rails new action-text-demo -d postgresql
rails g scaffold Blog

Install action text into your app

Read More

How to write single line functions in ruby

Ruby provides several ways using which one can write one line functions. However, over the years, having done several code reviews, I've seen this feature seldom used. In this article, we will go through various way of writing single-line functions.

One line functions as the name imply is a short function which takes 1 LOC. Because they are short...

Read More

Active Record delegated type

Rails 6 has added a new feature that adds delegated_type to Active Record. In this blog post, we are going to learn how to use delegated_type in our Active Record model using a real-life project and also discuss the benefits of using it.


Implement a School Management System. The system will have Users with different profiles. eg: Student...

Read More

How to setup Openresty/Nginx to auto generate SSL certificates for all your registered domains/subdomains

Generating SSL certificates using Let's Encrypt and Certbot has long been the norm. It is often used as a default choice when it comes to generating SSL certificates. Certbot makes it intuitive and seamless to generate SSL certificates for any site we wish.

What if we wanted to generate SSL certificates on the fly, entirely automating the...

Read More

10 Rails Antipatterns to avoid - Writing well reasoned code

Ruby on rails certainly makes it easier for developers to bootstrap applications and POCs at a pace which is hard to imagine achieving using any other framework. The MVC architecture of the framework ties up together many pathways which speeds things up in terms of development speed. And as a consequence, it brings along with a few antipatterns...

Read More


Rails 4.2+ has introduced an environment variable in production ENV['RAILS_SERVE_STATIC_FILES'] which disallows serving static files and assets by default.

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present...
Read More

10 ways to optimize your AWS resources saving costs

AWS offers amazing tools to scale up. But, this can also turn out to be a double-edged sword if not used properly. This article helps us to uncover some of the popular AWS cost management best practices.

With several years of experience, we have managed to come up with a cheet-sheet of best practices. The screenshot below shows 75% cost reduction...

Read More leaky AWS bucket

How we made an ungrateful to pull up their sleeves and fix their Leaky AWS Bucket?

We at Acuments have a keen eye on web security. We take particular interest in companies whose business revolve around the community. In this case, they help Students prepare for placements.

On Visiting their site, the following section caught our attention...

Read More