Code Explainers

Code explainers tagged #strong parameters

ruby
class ProductsController < ApplicationController
  def index
    @products = Product
      .includes(:category, :brand)

Building a safe filterable product index in Rails

query objects scopes strong parameters
Intermediate 8 steps
ruby
class User < ApplicationRecord
  has_one_attached :avatar
 
  validate :acceptable_avatar

Validating and serving avatars with Active Storage in Rails

active storage file uploads validation
Intermediate 9 steps