Skip to main content
March 23, 2026Noble Desktop Publishing Team/8 min read

Markdown, Customizing Active Admin

Master Active Admin customization and Markdown rendering

Key Technologies Covered

Active Admin Customization

Learn to customize product columns, filters, and dashboard views for cleaner admin interfaces. Transform cluttered admin pages into streamlined management tools.

Markdown with Kramdown

Implement Markdown processing using the Kramdown gem to convert plain text into formatted HTML with bulleted lists and rich content.

Rails View Enhancement

Enhance product display pages with dynamic content rendering and improve user experience through better content presentation.

Topics Covered in This Ruby on Rails Tutorial:

Implementing Markdown rendering for dynamic content, customizing product data columns for optimal admin experience, and streamlining the filter sidebar for enhanced productivity

Exercise Overview

In this comprehensive exercise, we'll explore advanced Active Admin customization techniques that professional Rails developers use daily. You'll transform a cluttered Products admin interface into a streamlined, production-ready dashboard that enhances administrative efficiency and user experience.

  1. If you've successfully completed exercises 8A–8C, you can proceed directly to the next section. We strongly recommend completing those foundational exercises first, as they establish the essential Active Admin configuration we'll be building upon. If you haven't completed the prerequisite exercises, follow the setup instructions below.

    Prerequisites

    This tutorial assumes completion of exercises 8A-8C. If you haven't completed them, follow the setup instructions to clone the repository and checkout to the correct branch.

Setup Instructions for New Participants (Exercises 8A–8C Not Completed)

  1. Close any files you may have open in your code editor.
  2. Open the Finder and navigate to Class Files > yourname-Rails Class
  3. Launch Terminal from your Applications folder or using Spotlight search.
  4. Type cd followed by a single space (do NOT press Return yet).
  5. Drag the yourname-Rails Class folder from the Finder window directly into the Terminal window, then press ENTER to execute the command.
  6. Execute rm -rf nutty to remove any existing copy of the nutty project directory.
  7. Clone the repository by running Git clone https://bitbucket.org/Noble Desktop/nutty.Git to download the complete That Nutty Guy project.
  8. Navigate into the project directory with cd nutty.
  9. Switch to the correct branch using Git checkout 8C to ensure your codebase matches the exercise starting point.
  10. Install all required Ruby gems by running bundle install.
  11. Install JavaScript dependencies with yarn install --check-files to ensure all frontend assets are properly configured.

Implementing Markdown Rendering for Dynamic Content

Now that our development environment is properly configured, let's tackle one of the most common challenges in content management: converting plain text input into properly formatted HTML output using Markdown.

  1. Ensure your Rails development server is running and navigate to localhost:3000 in your browser. This local development environment allows us to test changes in real-time without affecting production systems.

  2. Click on the Finger Tentacles product link to access its dedicated product page.

  3. Navigate to the Specs tab located to the right of the product image.

    Notice how the specifications display as a properly formatted, bulleted list rather than a dense paragraph of text. This enhanced readability significantly improves user experience and information accessibility.

  4. Access the admin interface by navigating to localhost:3000/admin and authenticate with your admin credentials.

  5. Click the Products navigation link to view the complete product inventory.

  6. Locate the Finger Tentacles entry in the product list and click the corresponding Edit link to access the product modification interface.

  7. Scroll down to examine the Specs field content. Our objective is to automatically convert this plain text format into the formatted HTML list displayed on the public product page.

    We'll implement Markdown processing to achieve this transformation. Markdown is an industry-standard lightweight markup language that allows content creators to write using intuitive plain text formatting that converts seamlessly to HTML. The asterisk (*) character at the beginning of each line creates bulleted list items when processed through a Markdown parser.

  8. We'll integrate the Kramdown gem, a robust Ruby-based Markdown processor that's widely adopted in production Rails applications. For comprehensive documentation and advanced configuration options, visit the official repository at GitHub.com/gettalong/kramdown.

  9. Open the nutty > Gemfile in your code editor. This file manages all Ruby dependencies for your Rails application.

  10. Add the Kramdown dependency by appending the following code to the bottom of the file:

    # Parse markdown for product descriptions & specs
    gem 'kramdown'
  11. Save and close the Gemfile to prepare for gem installation.

  12. Switch to your Terminal window containing the active Rails server process.

  13. Stop the development server by pressing CTRL–C. This is necessary when adding new gems to ensure they're properly loaded into the Rails environment.

  14. Install the new gem dependency by executing:

    bundle install
  15. Restart the development server to load the new Kramdown functionality:

    rails server
  16. Navigate to the product view template by opening nutty > app > views > products > show.html.erb in your code editor.

  17. Locate the specs tab content around line 51 and implement Markdown processing by replacing the existing code with:

    <div class="tab-pane fade" id="specs" role="tabpanel" aria-labelledby="specs-tab">
       <%= raw Kramdown::Document.new(@product.specs).to_html %>
    </div> <!—/ #specs—>

    This implementation leverages Kramdown::Document.new().to_html to instantiate a new Kramdown document with the product specs content and convert it to HTML. The raw method prevents Rails from automatically escaping the HTML output, allowing the formatted content to render properly in the browser.

  18. Save the template file to apply your changes.

  19. Return to your browser and navigate to localhost:3000 to test the implementation.

  20. Access the Finger Tentacles product page to verify the changes.

  21. Click the Specs tab to confirm that the Markdown processing now renders the specifications as a properly formatted bulleted list. This dynamic content rendering significantly enhances the administrative workflow by allowing non-technical users to create formatted content using simple text conventions.

  22. Keep both browser tabs and the Terminal server process active for the subsequent exercises, as we'll continue building upon this foundation.

Advanced Admin Interface Customization

With Markdown rendering successfully implemented, let's focus on optimizing the administrative interface for maximum productivity and usability.

  1. Access the admin dashboard by navigating to localhost:3000/admin and authenticating with your administrative credentials.

  2. Click the Products link in the main navigation. You'll immediately notice that the default Active Admin interface displays excessive information that clutters the view and reduces administrative efficiency.

  3. We'll continue working within the nutty project directory located at Desktop > Class Files > yourname-Rails Class > nutty. If your code editor supports project-wide file management (like VS Code, Sublime Text, or RubyMine), we recommend opening the entire nutty folder as a project for enhanced navigation and file management capabilities.

  4. Open nutty > app > admin > product.rb in your code editor. This file controls all Active Admin configuration for the Product model.

  5. Implement custom column configuration by adding the index block shown in bold:

    ActiveAdmin.register Product do
       permit_params :title, :description, :specs, :sku, :price, :image
    
       index do
          selectable_column
          column :image do |product|
             image_tag url_for(product.image.variant(resize: "100x100"))
          end
          column :title
          column :sku
          column :price
          column :created_at
          actions
       end
    
       show do

    This configuration creates a streamlined admin interface where selectable_column provides bulk action checkboxes for efficient multi-product operations, while actions generates the essential View, Edit, and Delete links. The custom image column automatically resizes product images to consistent 100x100 pixel thumbnails for optimal visual scanning.

  6. Save the file and refresh localhost:3000/admin/products in your browser to see the dramatic improvement in interface clarity and usability. Notice how the Filters sidebar on the right still contains numerous search criteria that may overwhelm administrators with too many options.

  7. Return to product.rb and implement selective filtering by adding the filter configuration above the index block:

    permit_params :title, :description, :specs, :sku, :price, :image
    
    filter :title
    filter :sku
    filter :created_at
    filter :price
    
    index do

    This curated filter selection focuses on the most commonly used search criteria while eliminating administrative interface bloat.

  8. Save the configuration file to apply the changes.

  9. Refresh localhost:3000/admin/products in your browser to observe the significantly cleaner, more focused administrative interface. The streamlined filters enable administrators to quickly locate specific products without cognitive overload from excessive options.

    With our administrative interface optimization complete, we can safely shut down the development server.

  10. Switch to your Terminal application.

  11. Navigate to the tab running the Rails development server.

  12. Terminate the server process using CTRL–C.

  13. Exit Terminal when you're finished with the development session.

Advanced Challenge: Dashboard Customization

For developers ready to push their Active Admin expertise further, dashboard customization offers powerful opportunities to create executive-level reporting and administrative oversight tools.

  1. Initialize your development environment by navigating to the nutty project directory in Terminal:
    • Type cd followed by a space character.
    • Drag the nutty folder from Desktop > Class Files > yourname-Rails Level 2 Class directly onto the Terminal window to automatically populate the full directory path.
    • Press Return to execute the directory change command.
  2. Start the Rails development server:

    rails server
  3. Navigate to the admin interface at localhost:3000/admin in your browser.

  4. Complete the authentication process if prompted by the system.

  5. Click the Dashboard link in the top navigation to access Active Admin's central command center. This area serves as the primary landing page for administrators and can be customized to display critical business metrics, recent activity summaries, and quick-access tools.

  6. Examine the dashboard configuration by opening nutty > app > admin > dashboard.rb in your code editor.

    This file contains comprehensive examples (currently commented out) demonstrating various widget types you can implement, including data tables, charts, recent activity feeds, and custom HTML sections that can integrate with external APIs or generate real-time business intelligence reports.

  7. For an advanced challenge that will enhance your Active Admin expertise, implement a two-column dashboard layout featuring:

    • A "Newest Products" widget displaying the five most recently created products with creation timestamps
    • A "Premium Inventory" widget showcasing the highest-priced products for executive visibility into luxury inventory management

    These widgets should leverage Active Record queries and demonstrate proper data presentation techniques used in production e-commerce applications.

  8. Remember to stop the development server using CTRL–C in Terminal and quit the Terminal application before proceeding to subsequent exercises to maintain a clean development environment.

Key Takeaways

1Kramdown gem enables seamless conversion of Markdown syntax to HTML, allowing content creators to use simple asterisk notation for bulleted lists
2Active Admin customization through product.rb allows developers to create cleaner, more focused admin interfaces by selecting specific columns and filters
3Image handling in admin panels can be optimized using Rails variants with resize parameters to create consistent thumbnail displays
4Custom filter configuration in Active Admin reduces interface clutter by showing only relevant search criteria for administrators
5The raw helper method in Rails views is essential when rendering processed Markdown content to prevent HTML escaping
6Active Admin dashboard customization offers flexibility to create business-specific widgets showing newest products, expensive items, or other key metrics
7Proper gem installation workflow requires stopping the server, running bundle install, and restarting to ensure new dependencies are loaded correctly
8Selective column display in admin interfaces improves usability by focusing on essential information like title, SKU, price, and creation date

RELATED ARTICLES