Skip to content
  • Jeremy Green's avatar
    a4305e17
    Add resource name to the `ArgumentError` that's raised when invalid `:only` or... · a4305e17
    Jeremy Green authored
    Add resource name to the `ArgumentError` that's raised when invalid `:only` or `:except` options are given to `#resource` or `#resources`
    
    This makes it easier to locate the source of the problem, especially for routes drawn by gems.
    
    Before:
    
        :only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
    
    After:
    
        Route `resources :products` - :only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
    
    Fixes https://github.com/rails/rails/issues/54134
    a4305e17
    Add resource name to the `ArgumentError` that's raised when invalid `:only` or...
    Jeremy Green authored
    Add resource name to the `ArgumentError` that's raised when invalid `:only` or `:except` options are given to `#resource` or `#resources`
    
    This makes it easier to locate the source of the problem, especially for routes drawn by gems.
    
    Before:
    
        :only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
    
    After:
    
        Route `resources :products` - :only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
    
    Fixes https://github.com/rails/rails/issues/54134
Loading