Can't find a route with an underscore or doesn't treat it properly

Viewed 907

I have this in routes:

Rails.application.routes.draw do
  namespace :api do
    namespace :v3_4 do
      # .....

And the controller app/controllers/api/v3_4/base_controller

module Api
  module V3_4
    class BaseController < ApplicationController
      # ......
    end
  end
end

And app/controllers/api/v3_4/another_controller

module Api
  module V3_4
    class AnotherController < ApplicationController

    end
  end

end

rake routes:

          Prefix Verb        URI Pattern                     Controller#Action
   api_v3_4_test GET         /api/v3_4/test(.:format)        api/v3_4/base#test
 api_v3_4_one GET|OPTIONS /api/v3_4/one(.:format)      api/v3_4/another#one
        api_v3_4 GET|OPTIONS /api/v3_4/two/:id(.:format)  api/v3_4/another#two

And yet for this request I get Routing Error Uninit Constant uninitialized constant Api::V34

Note there's no underscore in the error message. But my project there's no line V34 at all, neither v34, only v3_4 and V3_4

2 Answers
Related