diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 97ad913..306a6e2 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -13,13 +13,18 @@ class ApplicationController < ActionController::Base def self.no_design_blocks @no_design_blocks = true end + def self.uses_design_blocks? + !@no_design_blocks + end + def uses_design_blocks? + self.class.uses_design_blocks? + end module UsesDesignBlocksHelper def uses_design_blocks? - ! self.class.instance_variable_get('@no_design_blocks') + @controller.uses_design_blocks? end end helper UsesDesignBlocksHelper - include UsesDesignBlocksHelper # Be sure to include AuthenticationSystem in Application Controller instead include AuthenticatedSystem diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index eef613a..2592d22 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -6,6 +6,8 @@ class SearchController < ApplicationController before_filter :prepare_filter before_filter :check_search_whole_site + no_design_blocks + protected def search(finder, query) diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 07731eb..a3ee043 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -467,5 +467,10 @@ class SearchControllerTest < Test::Unit::TestCase get :assets, :asset => 'products' assert_equal 'Products', assigns(:asset_name) end + + should 'not use design blocks' do + get :index + assert_no_tag :tag => 'div', :attributes => { :id => 'boxes', :class => 'boxes' } + end end -- libgit2 0.21.2