drapergem/draper

Decorators/View-Models for Rails Applications

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 36 minutes ago
Added to GitGenius on September 12th, 2026
Created on June 30th, 2011
Open Issues & Pull Requests: 28 (+0)
GitHub issues: Enabled
Number of forks: 523
Total Stargazers: 5,276 (+0)
Total Subscribers: 65 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.6 hours
Mean response time: 185.5 days
90th percentile: 416.7 days
Tracked items: 63

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 5% of issues opened in the past year have been closed. Three people close 71% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 14
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 2,398 days
Stale 30+ days: 14
Stale 90+ days: 14

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • associations (8)
  • inference (8)
  • suggestion (7)
  • view_context (5)
  • awaiting response (4)
  • delegation (4)
  • namespaces (4)
  • helpers (3)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Draper is a decorator library for Rails applications that provides an object-oriented layer for presentation logic.

The problem Draper solves is the scattered nature of view-related logic in Rails applications. Without a dedicated abstraction, presentation concerns end up either tangled in procedural helper methods or bloating model classes. Draper's approach wraps models with decorator objects that handle only presentation-related logic. These decorators inherit from Draper::Decorator, live in the app/decorators directory, and delegate to the underlying model while adding view-specific methods. This keeps presentation logic organized, testable, and properly scoped rather than spread across a global helper namespace or mixed into domain models.

Draper suits Rails developers who want to separate presentation concerns from business logic and helpers. It works well for applications where you need to format complex data for display, define multiple representations of an object, or add semantic HTML markup to attributes. The decorator pattern is particularly valuable when you have multiple model types that need similar presentation logic but with type-specific variations—instead of creating a proliferation of helper methods or using conditional logic in helpers, each model type gets its own decorator with appropriate methods. This approach is especially useful for teams that value object-oriented design and want their view layer to be as testable and maintainable as their models and controllers.

The project maintains active engagement with its codebase, regularly addressing issues and pull requests from the community. Development shows consistent attention to keeping the library compatible with current Rails and Ruby versions. The maintainers respond to user questions and concerns raised in the repository, indicating ongoing stewardship of the tool.