mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
Use ViewHelpers in collection decorator
This commit is contained in:
parent
7db9e224a0
commit
23c78ba453
1 changed files with 1 additions and 5 deletions
|
@ -2,6 +2,7 @@ require 'active_support/core_ext/object/blank'
|
|||
module Draper
|
||||
class CollectionDecorator
|
||||
include Enumerable
|
||||
include ViewHelpers
|
||||
|
||||
delegate :as_json, :collect, :map, :each, :[], :all?, :include?, :first, :last, :shift, :in_groups_of, :to => :decorated_collection
|
||||
|
||||
|
@ -73,11 +74,6 @@ module Draper
|
|||
end
|
||||
alias_method :to_source, :source
|
||||
|
||||
def helpers
|
||||
Draper::ViewContext.current
|
||||
end
|
||||
alias_method :h, :helpers
|
||||
|
||||
private
|
||||
def self.discern_class_from_my_class default_class
|
||||
return default_class if default_class
|
||||
|
|
Loading…
Add table
Reference in a new issue