Skip to content
  • Petrik's avatar
    5411565d
    Add DidYouMean for ParameterMissing · 5411565d
    Petrik authored
    If a parameter isn't found we can suggest similar params:
    
    ```
    class BooksController < ActionController::Base
      def create
        params.require(:book).require(:name)
        head :ok
      end
    end
    
    post :create, params: { magazine: { name: "Mjallo!" } }
    
    param is missing or the value is empty: book
    Did you mean?  controller
                   action
                   magazine
    
    post :create, params: { book: { title: "Mjallo!" } }
    
    param is missing or the value is empty: name
    Did you mean?  title
    
    ```
    5411565d
    Add DidYouMean for ParameterMissing
    Petrik authored
    If a parameter isn't found we can suggest similar params:
    
    ```
    class BooksController < ActionController::Base
      def create
        params.require(:book).require(:name)
        head :ok
      end
    end
    
    post :create, params: { magazine: { name: "Mjallo!" } }
    
    param is missing or the value is empty: book
    Did you mean?  controller
                   action
                   magazine
    
    post :create, params: { book: { title: "Mjallo!" } }
    
    param is missing or the value is empty: name
    Did you mean?  title
    
    ```
Loading