diff options
Diffstat (limited to 'app/helpers/content_helper.rb')
| -rw-r--r-- | app/helpers/content_helper.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb index 17364f8b..dbe468e3 100644 --- a/app/helpers/content_helper.rb +++ b/app/helpers/content_helper.rb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | module ContentHelper | 1 | module ContentHelper |
| 2 | 2 | ||
| 3 | def main_menu | 3 | def main_menu |
| 4 | menu_items = MenuItem.all(:order => "position ASC") | 4 | menu_items = MenuItem.order("position ASC").all |
| 5 | render( | 5 | render( |
| 6 | :partial => 'content/main_navigation', | 6 | :partial => 'content/main_navigation', |
| 7 | :locals => {:menu_items => menu_items} | 7 | :locals => {:menu_items => menu_items} |
| @@ -51,7 +51,7 @@ module ContentHelper | |||
| 51 | end | 51 | end |
| 52 | 52 | ||
| 53 | def page_title | 53 | def page_title |
| 54 | if @page.title && @page.title != "" | 54 | if @page && @page.title && @page.title != "" |
| 55 | "CCC | #{@page.title}" | 55 | "CCC | #{@page.title}" |
| 56 | else | 56 | else |
| 57 | "CCC | Chaos Computer Club" | 57 | "CCC | Chaos Computer Club" |
| @@ -75,7 +75,7 @@ module ContentHelper | |||
| 75 | def aggregate? content | 75 | def aggregate? content |
| 76 | options = {} | 76 | options = {} |
| 77 | 77 | ||
| 78 | cccms_attributes = ActionView::Base.sanitized_allowed_attributes + [ 'lang' ] | 78 | cccms_attributes = ActionView::Base.sanitized_allowed_attributes + ['lang'] |
| 79 | 79 | ||
| 80 | begin | 80 | begin |
| 81 | if content =~ /<aggregate([^<>]*)>/ | 81 | if content =~ /<aggregate([^<>]*)>/ |
| @@ -126,9 +126,7 @@ module ContentHelper | |||
| 126 | # Check if a custom partial exists in the proper location | 126 | # Check if a custom partial exists in the proper location |
| 127 | def partial_exists? partial | 127 | def partial_exists? partial |
| 128 | File.exist?( | 128 | File.exist?( |
| 129 | File.join( | 129 | Rails.root.join('app', 'views', 'custom', 'partials', "_#{partial}.html.erb") |
| 130 | RAILS_ROOT, 'app', 'views', 'custom', 'partials', "_#{partial}.html.erb" | ||
| 131 | ) | ||
| 132 | ) | 130 | ) |
| 133 | end | 131 | end |
| 134 | 132 | ||
