We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
If you want to use the Draper gem together with Decent Exposure, you can use the following strategy:
class DecoratorStrategy < DecentExposure::ActiveRecordWithEagerAttributesStrategy def resource r = super.tap { |r| r.class.send(:include, Draper::Decoratable) unless r.respond_to?(:decorate) } r.decorate end end
class UsersController < ApplicationController expose :user, strategy: DecoratorStrategy end
It uses the default strategy (ActiveRecordWithEagerAttributesStrategy) and does two things on top of it:
ActiveRecordWithEagerAttributesStrategy
Draper::Decoratable
.decorate
decent exposure