Module: Qbrick::Cms::PagesHelper

Defined in:
app/helpers/qbrick/cms/pages_helper.rb

Instance Method Summary collapse

Instance Method Details

#content_tab_active(page) ⇒ Object



4
5
6
# File 'app/helpers/qbrick/cms/pages_helper.rb', line 4

def content_tab_active(page)
  :active unless hide_content_tab?(page)
end

#hide_content_tab?(page) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/helpers/qbrick/cms/pages_helper.rb', line 12

def hide_content_tab?(page)
  page.redirect? || !page.translated? || !page.persisted? || page.errors.present?
end

#metadata_tab_active(page) ⇒ Object



8
9
10
# File 'app/helpers/qbrick/cms/pages_helper.rb', line 8

def (page)
  :active if hide_content_tab?(page)
end