From f3b69bc57b625544edadc547d849e32e609b9b18 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Mon, 14 Dec 2009 22:34:31 -0600 Subject: [PATCH] Make xhtml_enabled? a Protected Method ... as it should be. Remarkably, it's still possible to use it in views, if you declare it a helper method. --- app/controllers/application_controller.rb | 4 +++- app/views/layouts/default.rhtml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2bd72b50..ae01f86d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -19,11 +19,13 @@ class ApplicationController < ActionController::Base Wiki.new end + protected + def xhtml_enabled? in_a_web? and [:markdownMML, :markdownPNG, :markdown].include?(@web.markup) end - protected + helper_method :xhtml_enabled? def check_authorization if in_a_web? and authorization_needed? and not authorized? diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 505246af..0d0c62d8 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -41,7 +41,7 @@

- <%= render(:file => 'svg_logo') if @controller.xhtml_enabled? %> + <%= render(:file => 'svg_logo') if xhtml_enabled? %> <%- if @page and (@page.name == 'HomePage') and %w( show published print ).include?(@action_name) -%> <%= h(@web.name) + (@show_diff ? ' (changes)' : '') %> <%- elsif @web -%>