All Stories

Reset primary key sequence

Resetting primary key sequence in Rails can be achieved by simply calling method reset_pk_sequence! on ActiveRecord with table_name.

In Rails, Postgres, Database, Apr 16, 2020

Sending Email from Rails

Sending email is integral part of every web application nowadays. In this post we will cover how to send emailsfrom a rails application.

In Rails, Email, Mar 06, 2020

Ruby date formatting

Ruby provides two classes to format date string strftime and strptime.

In Rails, Ruby, Jan 01, 2020

json and jsonb - Postgresql

Postgresql provides a data-type jsonb to save data from JSON format. There are two ways for it - using jsonand jsonb. This article will clarify difference in short terms.

In Rails, Postgres, Database, Dec 10, 2019

Sidekiq By Example : Ruby's background worker

What is the best way of handling background jobs in Rails, (maybe) using sidekiq.

In Rails, Sidekiq, Nov 28, 2019

Run seed data only on first Docker instance up

Q: Do we need to run rails db:seed, rails db:migrate every time the deployment happen? Ans - Absolutely no. rails db:seed should only run for the first time i.e. first deployment. But...

In Rails, Nov 22, 2019

HTTP request response headers

At the end browser talks in the language of HTTP request. But we really know minimal about it.

In Rails, Http, Aug 20, 2019

Ruby Ranges Overview

Range in ruby can be used in following situations

In Rails, Ruby, Aug 15, 2019

Useful Rails commands

rails dbconsole

In Rails, Command line, Aug 05, 2019

Rails 6 adds *_previously_was attributes method

Rails had previous_changes method to track value of object before and after save.

In Rails, new release, Aug 02, 2019