OSS Tanbou

wrap Rails models with decorators and view models so presentation logic stays out of models and global helpers

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
5,277
Primary language
Ruby
License
MIT
Repository last updated
May 29, 2026
On this page

Overview

Draper adds an object-oriented presentation layer to Rails applications through decorators and view models. It wraps models with display formatting, semantic markup, and view-specific representations so domain models and global helper namespaces remain focused.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Wrap models with decorators that add presentation methods

Classes derived from Draper::Decorator can implement display-oriented methods that do not belong in the domain model, while delegate_all exposes methods from the wrapped object.

Sources: [1]

Access Rails helpers from decorator methods

Decorators can call Rails helpers through h or helpers, allowing link generation and markup-related presentation behavior to live in the presentation layer.

Sources: [1]

Decorate collections and associated objects

decorate_collection, CollectionDecorator, and decorates_association extend the same presentation pattern to lists and related models.

Sources: [1]

Best fit

Fits Rails applications that need a clear presentation layer between models and views

Draper is useful when formatting and display-specific representations would otherwise make domain models bulky or spread helper methods across a broad global namespace.

Sources: [1]

Before adoption

Decorate immediately before rendering rather than during domain manipulation

The README describes decorators as objects for view consumption and warns against decorating early in controller actions and then attempting to manipulate decorated models.

Sources: [1]

Read compatibility information across the README, gemspec, and CI matrix

The README states official support from Rails 5.2 and Ruby 2.4 for Draper 4.x, while the gemspec has lower bounds of Ruby 2.2.2 and Rails dependencies 5.0+. The 4.0.6 CI matrix also tests modern Rails 8.1/8.0/7.2 with Ruby 3.4–3.1.

Sources: [1][2][3]

Ruby 3.2 with Rails 8.1 is temporarily excluded from the 4.0.6 CI matrix

The 4.0.6 release and CI configuration mark Ruby 3.2 + Rails 8.1 as temporarily unstable, so applications using that combination should run their own compatibility suite before upgrading.

Sources: [4][3]

Official sources

  1. [1]Draper 4.0.6 README(2026-10-04)
  2. [2]Draper 4.0.6 gemspec(2026-10-04)
  3. [3]Draper 4.0.6 CI matrix(2026-10-04)
  4. [4]Draper 4.0.6 release(2026-10-04)
  5. [5]Draper MIT license(2026-10-04)
Supplemental curator note

Draper is intended to move presentation concerns into decorators. Its README recommends decorating late, immediately before rendering; moving controller or domain behavior into decorators recreates blurred responsibilities. The 4.0.6 CI matrix tests modern Rails 8.1/8.0/7.2 with Ruby 3.4–3.1, while Ruby 3.2 + Rails 8.1 is temporarily excluded.

Try it in 3 steps

  1. 1

    Add Draper 4.0.6 to an existing Rails application

    Pin stable version 4.0.6 in the Rails project's Gemfile and resolve dependencies.

    bundle add draper --version 4.0.6
  2. 2

    Generate an ApplicationDecorator base

    Create ApplicationDecorator as a shared base for application decorators.

    bin/rails generate draper:install
  3. 3

    Generate a decorator for a model

    Create ArticleDecorator as the place to move display formatting and other presentation logic out of models and broad helper namespaces.

    bin/rails generate decorator Article
Check the official README

Growth

Growth trends · Last 30 days

5,277 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
8

Development activity is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • decorators
  • ruby
Stars
5,277
Forks
522
Watchers
65
Open issues
20
Contributors
162
Owner type
Organization
Primary language
Ruby
License
MIT
Repository last updated
May 29, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?