Class: Refinery::Admin::ListPresenter
- Inherits:
-
GroupPresenter
- Object
- GroupPresenter
- Refinery::Admin::ListPresenter
- Includes:
- ActionView::Helpers::TagHelper, ImagesHelper
- Defined in:
- app/presenters/refinery/admin/list_presenter.rb
Instance Attribute Summary
Attributes inherited from GroupPresenter
#context, #group_classes, #group_header, #group_headers, #group_tag, #group_wrapper, #groups, #header, #header_tag, #identity_keys
Instance Method Summary collapse
-
#initialize(context, header: ->(date) { localized(date) }, groups: ->(records) { context.group_by_date(records, :updated_at) }) ⇒ ListPresenter
constructor
Initialize the presenter with a context, a lambda for headers, and a lambda for groups.
Methods included from ImagesHelper
#locale_text_icon, #other_image_views, #thumbnail_urls
Constructor Details
#initialize(context, header: ->(date) { localized(date) }, groups: ->(records) { context.group_by_date(records, :updated_at) }) ⇒ ListPresenter
Initialize the presenter with a context, a lambda for headers, and a lambda for groups.
12 13 14 15 16 17 18 19 20 |
# File 'app/presenters/refinery/admin/list_presenter.rb', line 12 def initialize(context, header: ->(date) { localized(date) }, groups: ->(records) { context.group_by_date(records, :updated_at) }) super(context) @identity_keys = [:title, :filename, :alt] @group_headers = true @header = header @groups = groups end |