diff --git a/app/controllers/api/v2/api_controller.rb b/app/controllers/api/v2/api_controller.rb index 90a1c9b902..7264b93eac 100644 --- a/app/controllers/api/v2/api_controller.rb +++ b/app/controllers/api/v2/api_controller.rb @@ -33,11 +33,6 @@ module Api module ClassMethods def included(base) base.class_eval do - rescue_from(ActionController::ParameterMissing) do |exception| - render text: "Required parameter missing: #{exception.param}", - status: :bad_request - end - if (respond_to? :skip_before_filter) && (respond_to? :prepend_before_filter) skip_before_filter :disable_api prepend_before_filter :disable_everything_except_api diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d416c5fc04..1ee9580128 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -105,6 +105,11 @@ class ApplicationController < ActionController::Base render_error status: 422, message: 'Invalid form authenticity token.' unless api_request? end + rescue_from ActionController::ParameterMissing do |exception| + render text: "Required parameter missing: #{exception.param}", + status: :bad_request + end + before_filter :user_setup, :check_if_login_required, :log_requesting_user,