Module: MissingTemplate406::ActionControllerPatch

Defined in:
lib/missing_template_406/action_controller_patch.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/missing_template_406/action_controller_patch.rb', line 3

def self.included(base)
  base.class_eval do
    rescue_from ActionView::MissingTemplate do
      raise unless Rails.env.production?
      render nothing: true, status: :not_acceptable
    end
  end
end