search_handlers_controller.rb
class SearchHandlersController < ApplicationController
def match
@string = 'string'
@result = case params['search_style']
when 'match'
MatchService.call(@string)
...
MatchService.rb in /services:
# frozen_string_literal: true
class MatchService < ApplicationService
...
def call(string)
'Match'
end
end
Error when calling MatchService from SearchHandlersController#match:
NameError (uninitialized constant SearchHandlersController::MatchService):
app/controllers/search_handlers_controller.rb:18:in `match'