Chris Hough
Chris Hough

Reputation: 3558

rubocop self.routes custom routes

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?

Upvotes: 0

Views: 183

Answers (1)

Mori
Mori

Reputation: 27789

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

config.exceptions_app = routes

Upvotes: 0

Related Questions