Brand model, let’s create an Admin Dashboard interface so admins can manage brands — including editing the rich text description and uploading the logo.
Step 1: Scaffold the Admin UI
The Admin Scaffold generator creates a complete admin section for a resource:| File Type | Path | Description |
|---|---|---|
| Controller | app/controllers/spree/admin/brands_controller.rb | Handles the logic for the brands resource. |
| View | app/views/spree/admin/brands/index.html.erb | Displays the list of brands using the tables system. |
| View | app/views/spree/admin/brands/new.html.erb | Displays the new brand form. |
| View | app/views/spree/admin/brands/edit.html.erb | Displays the edit brand form. |
| Partial | app/views/spree/admin/brands/_form.html.erb | The form partial used in new and edit views. |
| Initializer | config/initializers/spree_admin_brands_table.rb | Registers the table with columns for the index view. |
| Initializer | config/initializers/spree_admin_brands_navigation.rb | Adds navigation to the admin sidebar. |
config/routes.rb file:
config/routes.rb
http://localhost:3000/admin/brands in your browser. To reference this route in your code, you can use the spree.admin_brands_path helper.
Step 2: Add the Description Editor and Logo Upload
The generated form only knows about thename column. Let’s add the rich text editor for description and the upload field for logo using Spree’s admin form builder:
app/views/spree/admin/brands/_form.html.erb
spree_rich_text_arearenders a WYSIWYG editor (Trix) for the Action Text description.spree_file_fieldhandles drag-and-drop upload, image preview, and direct upload to storage. Addcrop: trueto enable image cropping with a recommended-size indicator.
app/controllers/spree/admin/brands_controller.rb
http://localhost:3000/admin/brands/new, create a brand with a formatted description and a logo — everything saves through the standard form.
Step 3: Customize the Table Columns
The scaffold generator creates a table initializer atconfig/initializers/spree_admin_brands_table.rb with default columns:
config/initializers/spree_admin_brands_table.rb
Show the logo next to the name
To render the logo thumbnail in the name column — the same pattern the Products table uses — switch the column to a custom partial:config/initializers/spree_admin_brands_table.rb
app/views/spree/admin/tables/columns/_brand_name.html.erb
For complete table customization options including column types, filtering, sorting, and bulk actions, see the Admin Tables guide.
Step 4: Customize Navigation
The scaffold generator also creates a navigation initializer atconfig/initializers/spree_admin_brands_navigation.rb:
config/initializers/spree_admin_brands_navigation.rb
Adding to an Existing Submenu
To add “Brands” to the Products submenu instead, use theparent option:
config/initializers/spree_admin_brands_navigation.rb
For complete navigation API documentation including all available options, submenu creation, badges, and more, see the Admin Navigation guide. The form helpers used in Step 2 are documented in Form Builder and Components.

