Ruby on Rails - decorating a model using draper in ruby on rails - ruby on rails tutorial - rails guides - rails tutorial - ruby rails
Decorating a Model using Draper
- Draper automatically matches up models with their decorators by convention.
- Given a user variable containing an ActiveRecord object, we can access our decorator by calling decorate on the user, or by specifying the Draper class if we want to be specific.