Module: CmsHelper

Defined in:
app/helpers/cms_helper.rb

Instance Method Summary collapse

Instance Method Details

#admin_tab(title, path) ⇒ Object



2
3
4
# File 'app/helpers/cms_helper.rb', line 2

def admin_tab title, path
   :li, link_to(title, path), :class => (:current if request.path.include?(path))
end

#available_parent_pagesObject



6
7
8
9
10
11
12
13
14
# File 'app/helpers/cms_helper.rb', line 6

def available_parent_pages
  pages = []
  pages << { :title => t('kuhsaft.cms.pages.new.pages'), :link => kuhsaft.cms_pages_path(:locale => :en) }
  if params[:parent_id].present?
    parent_page = Kuhsaft::Page.find(params[:parent_id])
    pages += parent_page.parent_pages
  end
  pages << { :title => t('kuhsaft.cms.pages.new.new_page'), :link => '#' }
end