Details Table
The devil's in the details
Includes a Ruby component and corresponding Rails helper
RubyThis is a paid-only premium component
PremiumThe Details Table component displays individual record details in a clean key-value format. Perfect for showing detailed information about any ActiveRecord object with automatic handling of different data types including images, booleans, dates, URLs, and more.
Basic Example
Title | Mario Kart 8 |
Studio | Nintendo EPD |
Platform | Nintendo |
Release year | 2014 |
Genre | Arcade Racing |
Rating | 9.2 |
Multiplayer | |
Online multiplayer |
<%= render NitroKit::DetailsTable.new(@game) do |details| %>
<%= details.field :title %>
<%= details.field :studio %>
<%= details.field :platform %>
<%= details.field :release_year %>
<%= details.field :genre %>
<%= details.field :rating %>
<%= details.field :multiplayer %>
<% end %>
Custom Field Values
You can customize field values and labels by providing your own values or using block syntax for complex formatting.
Box art | ![]() |
Title | Rocket League |
Studio | Psyonix |
Price | Free |
Rating | 8.7/10 |
Website url | https://www.rocketleague.com/ |
Description | A high-powered hybrid of arcade-style soccer and vehicular mayhem with easy-to-understand controls and fluid physics-driven competition. |
Age | 10 |
Created at | September 01, 2025 21:42 |
<%= render NitroKit::DetailsTable.new(@game) do |details| %>
<%= details.field :title %>
<%= details.field :price, @game.price %>
<%= details.field :rating, @game.formatted_rating %>
<%= details.field "Age", @game.release_age do |age| %>
<%= age %> years old
<% end %>
<%= details.field :website_url %>
<%= details.field :description %>
<% end %>
Bulk Field Assignment
Use fields
to quickly add multiple standard fields at once.
Box art | ![]() |
Title | Mario Kart 8 |
Studio | Nintendo EPD |
Platform | Nintendo |
Release year | 2014 |
Genre | Arcade Racing |
Price | $59.99 |
Rating | 9.2 |
Metacritic score | 88 |
Multiplayer | |
Online multiplayer | |
Description | The definitive version of Mario Kart 8 and the biggest leap in the Mario Kart series. Get the complete Mario Kart experience. |
Website url | https://www.nintendo.com/store/products/mario-kart-8-deluxe-switch/ |
Created at | September 01, 2025 21:42 |
Updated at | September 01, 2025 21:51 |
<%= render NitroKit::DetailsTable.new(@game) do |details| %>
<%= details.fields :title, :studio, :platform, :release_year %>
<%= details.field :price, @game.price %>
<%= details.fields :rating, :metacritic_score %>
<%= details.fields :multiplayer, :online_multiplayer %>
<%= details.field :website_url %>
<% end %>
Install
PremiumSet up Nitro Kit then
bin/rails app:template \
LOCATION="https://nitrokit.dev/t/premium/details_table?license=LICENSE-KEY"
Usage
| ||
---|---|---|
Property | Default | Description |
record | ActiveRecord object | The record whose details you want to display. |
route_base | Symbol, Array, or nil |
Route prefix for ActiveRecord object links. Use :admin for admin routes or [:admin, :v2] for nested namespaces.
|
**attrs | HTML attributes for <table> element |
| ||
---|---|---|
Property | Default | Description |
attribute | Symbol or String | The attribute name to display. Used as both the field key and to fetch the value from the record (if no custom value provided). |
value | Any |
Optional custom value to display instead of record.send(attribute) .
|
block | Proc | Optional block for custom formatting. Block receives the field value as an argument. |
| ||
---|---|---|
Property | Default | Description |
attributes | Array of Symbols | Multiple attribute names to display using their default values and formatting. |
Helper Method
| ||
---|---|---|
Property | Default | Description |
record | ActiveRecord object | The record whose details you want to display. |
route_base | Symbol, Array, or nil |
Route prefix for ActiveRecord object links. Examples: :admin , [:admin, :v2] , or nil for default routes.
|
**attrs | HTML attributes for <table> element |
Automatic Value Formatting
The Details Table automatically formats different data types:
- URLs: Automatically converted to clickable links
- Booleans: Displayed as disabled checkboxes (checked/unchecked)
- Dates/Times: Formatted using Rails' localization helpers
- ActiveStorage attachments: Images shown as thumbnails, files as filename
- ActiveRecord objects: Linked with smart naming (configurable via route_base)
- Arrays/Collections: Items joined with commas
- Nil values: Displayed as "N/A" in muted text
- Numbers: Decimal values between 0-1 formatted as percentages