Implementing Jbuilder for creating JSON Response in Ruby on Rails
This article will discuss how to implement JBuilder for creating JSON response in Ruby on Rails.
This article will discuss how to implement JBuilder for creating JSON response in Ruby on Rails.
This article will discuss how to implement charts and graphs in Ruby on Rails 6 applications.
This article will discuss how to implement authorization in a Ruby on Rails application using CanCanCan. Here’s how to start:
This article will discuss how to integrate AWS S3 in a Ruby on Rails application using ActiveStorage.
This article will discuss how to scrape websites in Ruby and Selenium. CSS class selectors will be used to scrape the data.
This article will discuss how to implement multiple bootstrap themes in Ruby on Rails 6 applications. This article is a continuation of this article, which explains how to implement a single theme.
This article will discuss how to implement token-based authentication using a gem called devise_token_auth
. Here’s how to get started:
This article will discuss how to integrate VUE JS in a Ruby on Rails 6 application. Here’s how to start:
This article will explain how to use a bootstrap theme in a Ruby on Rails 6 application using AdmineLTE3. Start like this:
Frequently developers need to write data to files like .csv and .xlsx. This article will discuss this common use case in Ruby on Rails applications.
Imagine you have a fruit shop application built in Ruby on Rails. As a Rails developer, you know that to get to a specific fruit page, a URL like www.myfruitshop/1
will work - but it’s more user friendly to use something like this:
This article will discuss how to implement Ajax in a Rails 6 application. Here’s how to start:
As any Ruby on Rails developer knows, webpacker was a major addition in Rails 6. With the introduction of webpacker, Rails applications no longer need asset pipeline. The app/assets/javascript
is moved to app/javascript
.
This article will discuss how to attach images to a model from URLs with ActiveStorage.
Conditional validations can be used when a validation needs to be run only if a condition is satisfied. This can be implemented in many ways, a few of which we will discuss in this article.
It’s common to need to read data from .csv or .xlsx files and insert that data into the database. This is a frequent use case in web development. In this article, we will discuss this use case in Ruby on Rails applications.
For Rails developers, using enums with ActiveRecord is always a good choice when you have to manage the state of an object. For example, for an online shop, you may have three states of an order - i.e. received
, dispatched
and delivered
. One option is to add three boolean fields in the database for received
, dispatched
and delivered
, but this approach looks ugly. A cleaner approach is to add a single string column status that includes values of received
, dispatched
and delivered
, then add three methods in the model file.
Many applications use mobile number authentication instead of email-based authentication. This article will discuss the technique to override default authentication behavior. Here are the steps to authenticate using a mobile number:
This article will discuss how to send an sms in a Ruby on Rails application using Twilio.
Locking in a database means that no two or more sessions can update the same record at the same time until the lock is released. In this article we will discuss two main types of locking in Ruby on Rails; Optimistic Locking and Pessimistic Locking.
This article will discuss a concept known as Custom Validations
in Rails Active Record. There are two types of custom validations; Custom Validators and Custom Methods.
This article will discuss database transactions and how to use them in Ruby on Rails. Transaction in a database means the state of the database will only change if all the statements in a transaction block succeed, otherwise all the statements will roll back and no state change will occur.
This article will discuss the most basic technique to speed up a Rails application by optimizing database queries.
This article will discuss how to make search functionality easier and faster in Ruby on Rails through a gem called pg_search
. According to the official documentation:
This article will discuss Polymorphic Association, an important concept in Ruby on Rails.