<%= lato_page_head "Documentation" %>

How to use Lato Storage

lato_storage adds an Active Storage management section to a Lato admin panel. Use it to monitor uploaded files, inspect storage usage, and run cleanup operations from the back office.

Installation

Add Lato Storage to the application Gemfile:

gem "lato"
gem "lato_storage"

Install the engine and run migrations:

bundle
rails lato_storage:install:application
rails lato_storage:install:migrations
rails db:migrate

Mount the engine in config/routes.rb:

Rails.application.routes.draw do
  mount LatoStorage::Engine => "/lato-storage"

  # ...
end

Import styles in app/assets/stylesheets/application.scss:

@import "lato_storage/application";

Import JavaScript in app/javascript/application.js:

import "lato_storage/application"

Permissions

Users must be logged into Lato and must have Lato Storage admin permission enabled.

user = Lato::User.find_by(email: "admin@example.com")
user.update!(lato_storage_admin: true)

What admins can do

Performance configuration

Large applications can enable performance optimization for the dashboard. When enabled, some dashboard numbers can be estimates instead of exact values.

LatoStorage.configure do |config|
  config.optimize_performances = true
end

Keep optimization disabled when exact dashboard numbers are more important than speed. Enable it when storage tables become large and dashboard loading is slow.

Cleanup

The cleaner action runs as a Lato operation, so admins can follow progress and result in the operation page. Use it to remove files that are no longer attached to application records.

Before running cleanup in production, verify backups, storage retention rules, and application-specific file usage.