Class: RailsRoutesAnalyzer::RouteIssue::NoController

Inherits:
Base
  • Object
show all
Defined in:
lib/rails_routes_analyzer/route_issue/no_controller.rb

Instance Method Summary collapse

Methods inherited from Base

#append_verbose_message, fields, #format_actions, #human_readable_error, #initialize, #suggestion, #verbose_message

Constructor Details

This class inherits a constructor from RailsRoutesAnalyzer::RouteIssue::Base

Instance Method Details

#error_suggestion(has_present_actions:) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/rails_routes_analyzer/route_issue/no_controller.rb', line 16

def error_suggestion(has_present_actions:, **)
  if has_present_actions
    "remove case for #{controller_class_name} as it doesn't exist"
  else
    "delete, #{controller_class_name} not found"
  end
end

#human_readable_error_messageObject



10
11
12
13
14
# File 'lib/rails_routes_analyzer/route_issue/no_controller.rb', line 10

def human_readable_error_message
  "`#{route_creation_method}' call at #{file_location} there is no controller: #{controller_class_name} for '#{controller_name}' (actions: #{action_names.inspect})".tap do |msg|
    msg << " error: #{error}" if error.present?
  end
end

#try_to_fix_line(_line) ⇒ Object



24
25
26
# File 'lib/rails_routes_analyzer/route_issue/no_controller.rb', line 24

def try_to_fix_line(_line)
  '' # Delete
end