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.
Official sources
- [1]Draper 4.0.6 README(2026-10-04)
- [2]Draper 4.0.6 gemspec(2026-10-04)
- [3]Draper 4.0.6 CI matrix(2026-10-04)
- [4]Draper 4.0.6 release(2026-10-04)
- [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
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
Generate an ApplicationDecorator base
Create
ApplicationDecoratoras a shared base for application decorators.bin/rails generate draper:install - 3
Generate a decorator for a model
Create
ArticleDecoratoras the place to move display formatting and other presentation logic out of models and broad helper namespaces.bin/rails generate decorator Article
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
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Jekyll51,707 Stars
1 shared tag(s) · Same language
generate blog-aware static sites from Markdown and Liquid
Ruby - Mastodon50,345 Stars
1 shared tag(s) · Same language
run a community-governed server that federates across the Fediverse with ActivityPub
Ruby - Homebrew49,876 Stars
1 shared tag(s) · Same language
manage macOS and Linux software through the
Rubybrewpackage workflow - Chatwoot37,488 Stars
1 shared tag(s) · Same language
Unify web chat, email, WhatsApp, and social channels into shared inboxes, automation, and AI support
Ruby - Vagrant27,211 Stars
1 shared tag(s) · Same language
define portable development environments across providers with a Vagrantfile
Ruby - GitLab CE/EE Mirror24,554 Stars
1 shared tag(s) · Same language
inspect GitLab's large DevOps codebase through its GitHub mirror
Ruby
Report incorrect information
Tell us if any listing information is incorrect or outdated.