Rails 7.1 supports infinite ranges that can be used with Active Record length and inclusivity validators.
A blog about broadcasting turbo streams in Hotwire and solution to some of the common scenarios and issues faced while using them.
Rails provides the has_secure_password method, which makes it gloriously easy to implement authentication in our application. But we often need an extra layer of verification before allowing users to update certain fields. For e.g. Users must provide their “old” password when updating their email/password fields. Before Rails 7.1To implement this, we must manually add and validate the current_password accessor: # app/models/user.rb class User < ActiveRecord::Base has_secure_password attr_accessor :current_password end# app/controllers/passwords_controller.rb class PasswordsController < ApplicationController def update password_challenge = password_params.delete(:current_password)
Rails 7.1 adds the ability to define the number of locals a template can accept. To achieve this, add a locals magic comment inside the partial.
Ruby 3 has introduced an experimental feature called Ractors. In this article, let's learn more about Ractor with example usage.
Implement Font Awesome easily in your Android native app.
An ActiveRecord query by default uses the SELECT * operator to select all the fields from the result set. The ActiveRecord::QueryMethods#select method allows you to select a subset of fields from the result set. Before Rails 7.1 ActiveRecord::QueryMethods#select and ActiveRecord::QueryMethods#reselect only accept strings, symbols, or raw SQL to define columns and aliases to select. When querying a single model, we can provide column names as an array of strings or symbols, or we can provide raw SQL. > Model.select(:field, :other_field) > # OR > Model.select('field', 'other_field') > # OR >
Using ACS SDK, we can incorporate a chat feature into our application. In this article, we will see how we can overcome limitations of Chat SDK.
Rails 7.1 adds the --parent option using which we can create a job that inherits from the superclass. Let's learn how to use it.
Let's explore how we can use Chrome Dev Tools Protocols(CDP) with Capybara. We will look at headers, cookies, and cache manipulation using CDP