From ec9c68f039fbc8496d28111f2b08b41ef5c111c5 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 7 Feb 2013 17:26:40 +0800 Subject: [PATCH] Remove breadcrumb when home --- app/controllers/front_controller.rb | 1 + lib/parsers/parser_common.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/front_controller.rb b/app/controllers/front_controller.rb index 4158bf15..be975ffa 100644 --- a/app/controllers/front_controller.rb +++ b/app/controllers/front_controller.rb @@ -4,6 +4,7 @@ class FrontController < ApplicationController def show_breadcrumb @ancestors = Page.find(params[:id]).ancestors_and_self + @ancestors = nil if @ancestors.size == 1 end def show_banner diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 491b7a4e..b245f576 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -148,6 +148,7 @@ module ParserCommon def parse_breadcrumbs_edit(body = nil, page = nil, edit=nil) body.css('breadcrumb').each do |breadcrumb| ancestors = Page.find(page.id).ancestors_and_self rescue nil + ancestors = nil if ancestors.size == 1 res = '' if ancestors res << "