Module: Admin::PagesHelper
- Includes:
- NodeHelper, ReferencesHelper
- Defined in:
- app/helpers/admin/pages_helper.rb
Instance Method Summary collapse
- #class_of_page ⇒ Object
- #clean_page_description(page) ⇒ Object
- #filter ⇒ Object
- #meta_errors? ⇒ Boolean
- #status_to_display ⇒ Object
Instance Method Details
#class_of_page ⇒ Object
5 6 7 |
# File 'app/helpers/admin/pages_helper.rb', line 5 def class_of_page @page.class end |
#clean_page_description(page) ⇒ Object
22 23 24 |
# File 'app/helpers/admin/pages_helper.rb', line 22 def clean_page_description(page) page.description.to_s.strip.gsub(/\t/, '').gsub(/\s+/, ' ') end |
#filter ⇒ Object
9 10 11 |
# File 'app/helpers/admin/pages_helper.rb', line 9 def filter @page.parts.first.filter if @page.parts.respond_to?(:any?) && @page.parts.any? end |
#meta_errors? ⇒ Boolean
13 14 15 |
# File 'app/helpers/admin/pages_helper.rb', line 13 def !!(@page.errors[:slug] or @page.errors[:breadcrumb]) end |
#status_to_display ⇒ Object
17 18 19 20 |
# File 'app/helpers/admin/pages_helper.rb', line 17 def status_to_display @page.status_id = 100 if @page.status_id == 90 @display_status = Status.selectable.map { |s| [I18n.translate(s.name.downcase), s.id] } end |