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
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_layout ⇒ Object
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_layouts ⇒ Object
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_statuses ⇒ Object
20 21 22 |
# File 'app/helpers/puffer_pages_helper.rb', line 20 def possible_statuses PufferPages::Page.statuses end |
#puffer_layouts ⇒ Object
12 13 14 |
# File 'app/helpers/puffer_pages_helper.rb', line 12 def puffer_layouts PufferPages::Layout.order(:name).all.map(&:name) end |
#tree_page ⇒ Object
24 25 26 |
# File 'app/helpers/puffer_pages_helper.rb', line 24 def tree_page render :partial => 'tree_page', :object => record end |