fix decorate calls on collections after draper update

This commit is contained in:
Dmitriy Zaporozhets 2013-03-01 15:24:59 +02:00
parent 520f02259c
commit 6aead7991f
6 changed files with 15 additions and 14 deletions

View file

@ -1,27 +1,28 @@
class ApplicationDecorator < Draper::Base
class ApplicationDecorator < Draper::Decorator
delegate_all
# Lazy Helpers
# PRO: Call Rails helpers without the h. proxy
# ex: number_to_currency(model.price)
# CON: Add a bazillion methods into your decorator's namespace
# and probably sacrifice performance/memory
#
#
# Enable them by uncommenting this line:
# lazy_helpers
# Shared Decorations
# Consider defining shared methods common to all your models.
#
#
# Example: standardize the formatting of timestamps
#
# def formatted_timestamp(time)
# h.content_tag :span, time.strftime("%a %m/%d/%y"),
# class: 'timestamp'
# h.content_tag :span, time.strftime("%a %m/%d/%y"),
# class: 'timestamp'
# end
#
#
# def created_at
# formatted_timestamp(model.created_at)
# end
#
#
# def updated_at
# formatted_timestamp(model.updated_at)
# end