Module: AppyantraAdmin::PagesHelper
- Defined in:
- app/helpers/appyantra_admin/pages_helper.rb
Instance Method Summary collapse
- #categories ⇒ Object
- #default_category ⇒ Object
- #page_category(page) ⇒ Object
- #page_keywords(page) ⇒ Object
- #page_layouts ⇒ Object
- #published_status(page) ⇒ Object
Instance Method Details
#categories ⇒ Object
2 3 4 |
# File 'app/helpers/appyantra_admin/pages_helper.rb', line 2 def categories Page.where('category is not null').select('distinct category') end |
#default_category ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'app/helpers/appyantra_admin/pages_helper.rb', line 6 def default_category page = Page.where('category is not null').select('distinct category').first if page page.category else '' end end |
#page_category(page) ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/helpers/appyantra_admin/pages_helper.rb', line 23 def page_category page unless page.category.empty? page.category else 'Not specified.' end end |
#page_keywords(page) ⇒ Object
31 32 33 |
# File 'app/helpers/appyantra_admin/pages_helper.rb', line 31 def page_keywords(page) (page.keywords.collect{|pk| pk.keyword}).join(', ') end |
#page_layouts ⇒ Object
35 36 37 |
# File 'app/helpers/appyantra_admin/pages_helper.rb', line 35 def page_layouts ['None'] + AppyantraAdmin.page_layouts end |
#published_status(page) ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/helpers/appyantra_admin/pages_helper.rb', line 15 def published_status page if page.published 'Yes' else 'No' end end |