Catch missing parameter exceptions to render error
This commit is contained in:
parent
08d2ae59a5
commit
157844b4ae
|
|
@ -5,6 +5,10 @@ class ApplicationController < ActionController::API
|
||||||
|
|
||||||
before_action :configure_permitted_parameters, if: :devise_controller?
|
before_action :configure_permitted_parameters, if: :devise_controller?
|
||||||
|
|
||||||
|
rescue_from ActionController::ParameterMissing do |e|
|
||||||
|
render json: { error: e.message }, status: :bad_request
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def configure_permitted_parameters
|
def configure_permitted_parameters
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue