Do it like => validates :photos, attached: true, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 500.kilobytes }, limit: { min: 1, max: 3 }, aspect_ratio: :landscape, dimension: { width: { in: 800..1600 }
Active Storage Validations is a gem that simplifies the process of adding validations to files attached using the active_storage gem in Rails. It provides a range of features including validation for content type, size, dimensions, number of files, aspect ratio, and more. The gem allows for custom error messages and supports dynamic determination of values using procs.
Ruby on Rails, often referred to as Rails, is an open-source web application framework written in Ruby. Known for its convention over configuration and don't repeat yourself (DRY) principles, Rails simplifies and accelerates the development of database-backed web applications.