For many reasons you can try to avoid/verify the visits for categories, posts or any other, then by this way you can do it:
- Create an initializer
- Create a before filter for :category on CamaleonCms::FrontendController where this filter will check/validate the visited category
# config/initializers/custom_front_camaleon.rb
Rails.application.config.to_prepare do
CamaleonCms::FrontendController.class_eval do
before_action :check_category_visit
private
def check_category_visit
my_black_list = [1,2,3,4,5]
if my_black_list.include?(params[:category_id])
redirect_to my_error_url
end
end
end
end - Restart Server
Created at: 12 Jan 09:54 | Updated at: 12 Jan 09:54