Draper adds an object-oriented layer of presentation logic to your Rails application. Without Draper, this functionality might have been tangled up in procedural helpers or adding bulk to your models. With Draper decorators, you can wrap your models with presentation-related logic to organize and test this layer of your app much more effectively. Imagine your application has an Article model. With Draper, you'd create a corresponding ArticleDecorator. The decorator wraps the model, and deals only with presentational concerns. In the controller, you decorate the article before handing it off to the view. In the view, you can use the decorator in exactly the same way as you would have used the model. But whenever you start needing logic in the view or start thinking about a helper method, you can implement a method on the decorator instead.

Features

  • Write decorators
  • Decorate objects
  • Decorate Query methods
  • Draper works out the box
  • Configure its default functionality
  • Draper supports RSpec, MiniTest::Rails, and Test::Unit

Project Samples

Project Activity

See All Activity >

Categories

Design, 3D Modeling

License

MIT License

Follow Draper

Draper Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Draper!

Additional Project Details

Programming Language

Ruby

Related Categories

Ruby Design Software, Ruby 3D Modeling Software

Registered

2021-10-29