From cb7b7c4edf170ae84320ddbce11b803a37832cd0 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Mon, 25 Nov 2013 12:52:42 +0800 Subject: [PATCH] Fixed Footer to display even if the terms page is absent --- app/controllers/front_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/front_controller.rb b/app/controllers/front_controller.rb index 6b08f3b1..ec724109 100644 --- a/app/controllers/front_controller.rb +++ b/app/controllers/front_controller.rb @@ -13,10 +13,10 @@ class FrontController < ApplicationController def show_footer @page = Page.find(:all, :conditions => {:name => /terms/i}) - @name = @page.first.name if @page.first.name.present? + @name = @page.first.name if @page.first.present? @url = "/#{@name}" if @name.present? - if (!@site.enable_terms_of_use && @url.present?) + if (!@site.enable_terms_of_use && @page.first.present?) render :text => (@site.footer + "Terms of Use") else render :text => @site.footer