Browse Source

Fix 422 being returned instead of 404 when POSTing (#11574)

pull/4/head
Eugen Rochko 4 years ago
committed by GitHub
parent
commit
6e872c6dab
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      app/controllers/application_controller.rb

+ 2
- 0
app/controllers/application_controller.rb View File

@ -29,6 +29,8 @@ class ApplicationController < ActionController::Base
before_action :store_current_location, except: :raise_not_found, unless: :devise_controller?
before_action :require_functional!, if: :user_signed_in?
skip_before_action :verify_authenticity_token, only: :raise_not_found
def raise_not_found
raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}"
end

Loading…
Cancel
Save