Fixed Footer to display even if the terms page is absent

This commit is contained in:
saurabhbhatia 2013-11-25 12:52:42 +08:00
parent 7b0ac6b0dc
commit cb7b7c4edf
1 changed files with 2 additions and 2 deletions

View File

@ -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 + "<a href='#{@url}'>Terms of Use</a>")
else
render :text => @site.footer