Ruby in Rails
  • Home
  • Rails
  • Ruby
  • About
GitHub icon LinkedIn icon
Subscribe

Rails

A collection of 87 posts

Rails

Rails set timezone per request

Sometimes we need to have a request be processed in a particular timezone in Rails. To set a timezone per request in Rails, we can have an around filter that sets timezone, runs

Akshay Mohite Akshay Mohite 1 min read
Rails

Rails render 404 not found from a controller action

Rails redirects route not found requests to 404.html page. Sometimes, we need to redirect to 404 not found page from a controller action. This can be done by rendering 404.html page or raising

Akshay Mohite Akshay Mohite 1 min read
Rails

Do not set Time.zone to avoid timezone issues in Rails

Setting Time.zone in a Rails application changes time zone globally. Whenever Time.now is used in any other request, it uses whatever Time.zone is set to earlier. To avoid Time.zone issues, do not set

Akshay Mohite Akshay Mohite 2 min read
Rails

Rails 5.1 Encrypted secrets management

Before Rails 5.1, secrets management was a hassle. Gems like dotenv-rails, sekrets were being used to manage secrets in Rails applications. Rails 5.1 released secrets management feature based on sekrets gem. This article

Akshay Mohite Akshay Mohite 4 min read
Rails

Rails ActiveRecord Subqueries

Writing subqueries can be a tedious job, when working with Rails ActiveRecord. Rails ActiveRecord can handle subqueries. Subqueries can be written by passing ActiveRecord Relation in where clause. This article discusses how to

Akshay Mohite Akshay Mohite 3 min read
Rails

Rails find missing indexes on tables with lol_dba gem

Missing indexes on database tables causes performance issues. lol_dba gem helps finding out missing indexes on database table in Rails code. lol_dba performs static analysis of the code to find out missing indexes.

Akshay Mohite Akshay Mohite 2 min read
« Newer Posts Page 5 of 15 Older Posts »
Ruby in Rails © 2023
Latest Posts Github Twitter LinkedIn

Subscribe to Ruby in Rails

Stay up to date! Get all the latest posts delivered straight to your inbox