Module: ActiveAdmin::Resource::PagePresenters

Included in:
Page, ActiveAdmin::Resource
Defined in:
lib/active_admin/resource/page_presenters.rb

Instance Method Summary collapse

Instance Method Details

#get_page_presenter(action) ⇒ Object

Returns a stored page config

Parameters:

  • action (Symbol, String)

    The action to get the config for



22
23
24
# File 'lib/active_admin/resource/page_presenters.rb', line 22

def get_page_presenter(action)
  page_presenters[action.to_sym]
end

#page_presentersObject

A hash of page configurations for the controller indexed by action name



6
7
8
# File 'lib/active_admin/resource/page_presenters.rb', line 6

def page_presenters
  @page_presenters ||= {}
end

#set_page_presenter(action, page_presenter) ⇒ Object

Sets a page config for a given action

Parameters:

  • action (String, Symbol)

    The action to store this configuration for

  • page_presenter (PagePresenter)

    The instance of PagePresenter to store



14
15
16
# File 'lib/active_admin/resource/page_presenters.rb', line 14

def set_page_presenter(action, page_presenter)
  page_presenters[action.to_sym] = page_presenter
end