Module: PagesCore::Admin::ContentTabsHelper

Included in:
AdminHelper
Defined in:
app/helpers/pages_core/admin/content_tabs_helper.rb

Instance Method Summary collapse

Instance Method Details

#content_tab(name, options = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/helpers/pages_core/admin/content_tabs_helper.rb', line 14

def content_tab(name, options = {}, &)
  return unless block_given?

  tab = {
    name: name.to_s.humanize,
    key: options[:key] || name.to_s.underscore.gsub(/\s+/, "_"),
    options:,
    content: capture(&)
  }
  content_tabs.push(tab)
  content_tab_tag(tab[:key], tab[:content])
end

#content_tabsObject



6
7
8
# File 'app/helpers/pages_core/admin/content_tabs_helper.rb', line 6

def content_tabs
  @content_tabs ||= []
end

#content_tabs?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'app/helpers/pages_core/admin/content_tabs_helper.rb', line 10

def content_tabs?
  content_tabs.any?
end