0

Rubocop keeps choking on this line in my application.rb file, yet I need this to set my routes properly for custom error messages.

# use my own routes for error codes
config.exceptions_app = self.routes

My Routes File:

  # Override Error Codes
  match '/404', to: 'error#four_oh_four', via: :all
  match '/422', to: 'error#four_twenty_two', via: :all
  match '/500', to: 'error#five_hundred', via: :all

  # Monitors
  get '/ping', to: 'monitor#pinger'

  # Used for Development to work on status codes
  match '*a', to: 'error#four_oh_four', via: :all if Rails.env.development?

Rubocop Error: enter image description here

Does anyone have any thoughts on the best method to fix this instead of just ignoring it?

Chris Hough
  • 3,389
  • 3
  • 41
  • 80

1 Answers1

0

Rubocop is warning you that the self is not needed here, and it recommends leaving it out:

config.exceptions_app = routes
Mori
  • 27,279
  • 10
  • 68
  • 73