The controller:
# app/controllers/v1/nem_id_controller.rb
class V1::NemIDController < ApplicationController
end
I created an initializer to customize the inflection:
# config/initializers/zeitwerk.rb
Rails.autoloaders.each do |autoloader|
autoloader.inflector = Zeitwerk::Inflector.new
autoloader.inflector.inflect(
"nem_id" => "NemID"
)
end
The error:
expected file app/controllers/v1/nem_id_controller.rb to define constant V1::NemIdController
Inspired from: https://guides.rubyonrails.org/autoloading_and_reloading_constants.html#customizing-inflections
It does not work with inflection.acronym('ID') because it will cause this error: https://github.com/rails/rails/issues/40068