Reputation: 3558
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?
Does anyone have any thoughts on the best method to fix this instead of just ignoring it?
Upvotes: 0
Views: 183
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