Ask A Question

Notifications

You’re not receiving notifications from this thread.

Draper Gem or explicitly use Decorators and Presenters?

Ali Ahmed asked in Rails

Hi, my question is simple that sometimes I have to extend my model with methods that are usually for more advance business logics and sometimes I need some methods that are used in views (not specifically helpers), I believe the former can be named as decoraters and latter can be called as presenters. However, I know there's a gem named draper which has examples of only I GUESS the presenters, even tho its naming convention follows Decorators, but I need advice or ensure if I could use the same gem to make both decorators as well as presenters objects.

Because I am always confused if I have to create another presenters directory in my app folder and write presenters there or just do it in the existing decorators directory (from draper gem).

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.