This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired by Ryan Bates pro RailsCast "Presenters from Scratch" | |
# This is a proof of concept for 'automagically' creating presenter objects | |
# | |
# This assumes you have presenter objects that follow the convention | |
# Object => ObjectPresenter | |
# | |
# It intercepts the 'render' method in the controller, and does some | |
# introspection to see if there is a presenter defined for the class | |
# of the instance variable being looked at. If so, it makes a presenter | |
# and adds it as an instance variable |