doc update
This commit is contained in:
parent
1a6dc17134
commit
3f59cd3082
|
@ -13,6 +13,17 @@ require 'active_support/core_ext/class/attribute'
|
||||||
#
|
#
|
||||||
# @thing_1 and @thing_2 will be decorated right before a rendering occurs.
|
# @thing_1 and @thing_2 will be decorated right before a rendering occurs.
|
||||||
#
|
#
|
||||||
|
# You can also specify the decorator you wish to use for a particular instance variable:
|
||||||
|
#
|
||||||
|
# class StuffController < ApplicationController
|
||||||
|
# include DecoratesBeforeRendering
|
||||||
|
#
|
||||||
|
# decorates :thing_1, :with => ThingListDecorator
|
||||||
|
# decorates :thing_2
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# @thing_1 will be a ThingListDecorator (or contain them), and @thing_2 will be a Thing2Decorator.
|
||||||
|
#
|
||||||
module DecoratesBeforeRendering
|
module DecoratesBeforeRendering
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
def decorates(*unsigiled_ivar_names)
|
def decorates(*unsigiled_ivar_names)
|
||||||
|
|
Loading…
Reference in New Issue