Module: PufferPagesHelper
- Defined in:
- app/helpers/puffer_pages_helper.rb
Instance Method Summary collapse
- #application_layouts ⇒ Object
- #inherited_layout ⇒ Object
- #possible_layouts ⇒ Object
- #possible_statuses ⇒ Object
- #puffer_layouts ⇒ Object
- #tree_page ⇒ Object
Instance Method Details
#application_layouts ⇒ Object
7 8 9 |
# File 'app/helpers/puffer_pages_helper.rb', line 7 def application_layouts Dir.glob("#{view_paths.first}/layouts/[^_]*").flatten.map {|path| File.basename(path).gsub(/\..*$/, '')}.uniq end |
#inherited_layout ⇒ Object
15 16 17 |
# File 'app/helpers/puffer_pages_helper.rb', line 15 def inherited_layout record.inherited_layout_name && !record.root? ? [[t('puffer_pages.inherited_layout', :name => record.inherited_layout_name), '']] : [] end |
#possible_layouts ⇒ Object
3 4 5 |
# File 'app/helpers/puffer_pages_helper.rb', line 3 def possible_layouts inherited_layout + (application_layouts + puffer_layouts).uniq.sort end |
#possible_statuses ⇒ Object
19 20 21 |
# File 'app/helpers/puffer_pages_helper.rb', line 19 def possible_statuses Page.statuses end |
#puffer_layouts ⇒ Object
11 12 13 |
# File 'app/helpers/puffer_pages_helper.rb', line 11 def puffer_layouts Layout.order(:name).all.map(&:name) end |
#tree_page ⇒ Object
23 24 25 |
# File 'app/helpers/puffer_pages_helper.rb', line 23 def tree_page render :partial => 'tree_page', :object => record end |