diff options
Diffstat (limited to 'app/controllers/widgets_controller.rb')
-rw-r--r-- | app/controllers/widgets_controller.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/widgets_controller.rb b/app/controllers/widgets_controller.rb index bdbabeac4..017d3a77f 100644 --- a/app/controllers/widgets_controller.rb +++ b/app/controllers/widgets_controller.rb @@ -8,7 +8,7 @@ require 'securerandom' class WidgetsController < ApplicationController - before_filter :find_info_request + before_filter :check_widget_config, :find_info_request def show medium_cache @@ -40,4 +40,10 @@ class WidgetsController < ApplicationController @info_request = InfoRequest.find(params[:request_id]) end + def check_widget_config + unless AlaveteliConfiguration::enable_widgets + raise ActiveRecord::RecordNotFound.new("Page not enabled") + end + end + end |