Step 1: Create the boilerplate Admin Dashboard UI
Admin Scaffold generator is a tool that helps us create a complete Admin Dashboard UI for our new resource. Run the following command in our Spree application root directory:| 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 | Handles displaying the list of brands in the Admin Dashboard. |
| View | app/views/spree/admin/brands/new.html.erb | Handles displaying the new brand form in the Admin Dashboard. |
| View | app/views/spree/admin/brands/edit.html.erb | Handles displaying the edit brand form in the Admin Dashboard. |
| Partial | app/views/spree/admin/brands/_table_header.html.erb | Handles displaying the table header in the brands index view. |
| Partial | app/views/spree/admin/brands/_table_row.html.erb | Handles displaying the table row in the brands index view. |
| Partial | app/views/spree/admin/brands/_filters.html.erb | Handles displaying the filters in the brands index view. |
| Partial | app/views/spree/admin/brands/_form.html.erb | Handles displaying the form in the new and edit brand views. |
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 Navigation Menu Item
Now that we’ve created a complete Admin Dashboard UI for the brand resource, let’s add a navigation menu item to the main sidebar so we can access it from the admin dashboard. Add the following to yourconfig/initializers/spree.rb file:
config/initializers/spree.rb
Adding to an Existing Submenu
To add “Brands” to the Products submenu instead add a new submenu item:config/initializers/spree.rb
For complete navigation API documentation including all available options, submenu creation, badges, and more, see the Admin Navigation guide.

