Module: PufferPagesHelper

Defined in:
app/helpers/puffer_pages_helper.rb

Instance Method Summary collapse

Instance Method Details

#application_layoutsObject



8
9
10
# File 'app/helpers/puffer_pages_helper.rb', line 8

def application_layouts
  Dir.glob("#{view_paths.first}/layouts/[^_]*").flatten.map {|path| File.basename(path).gsub(/\..*$/, '')}.uniq
end

#inherited_layoutObject



16
17
18
# File 'app/helpers/puffer_pages_helper.rb', line 16

def inherited_layout
  record.inherited_layout_name && !record.root? ? [[t('puffer_pages.inherited_layout', :name => record.inherited_layout_name), '']] : []
end

#possible_layoutsObject



4
5
6
# File 'app/helpers/puffer_pages_helper.rb', line 4

def possible_layouts
  inherited_layout + (application_layouts + puffer_layouts).uniq.sort
end

#possible_statusesObject



20
21
22
# File 'app/helpers/puffer_pages_helper.rb', line 20

def possible_statuses
  PufferPages::Page.statuses
end

#puffer_layoutsObject



12
13
14
# File 'app/helpers/puffer_pages_helper.rb', line 12

def puffer_layouts
  PufferPages::Layout.order(:name).all.map(&:name)
end

#tree_pageObject



24
25
26
# File 'app/helpers/puffer_pages_helper.rb', line 24

def tree_page
  render :partial => 'tree_page', :object => record
end