From f631ac6b963eee49d909449a582ac2e3683ca6bd Mon Sep 17 00:00:00 2001 From: Rhenium Date: Fri, 17 Jan 2014 23:12:40 +0900 Subject: fix ApplicationController --- app/controllers/application_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f3ce3ee..c223366 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base end def authorized_to_show_user?(user) - !user.protected? || current_user == user || current_user.try(:following?, user) + !user.protected? || current_user == user || current_user.try(:following?, user) || false end def authorized_to_show_user_best?(user) @@ -46,6 +46,8 @@ class ApplicationController < ActionController::Base end def tidy_response_body - response.body = ActiveSupport::Multibyte::Unicode.tidy_bytes(response.body) + if [:html, :xml, :rss, :atom].any? {|s| request.format == s } + response.body = ActiveSupport::Multibyte::Unicode.tidy_bytes(response.body) + end end end -- cgit v1.2.3