I have this in routes:
Rails.application.routes.draw do
namespace :api do
namespace :v3_4 do
# .....
And the controller app/c
Rails inflects _
to be a word separator, so it searches for Api::V34 you can change that behavior by editing config/initializers/inflections.rb
:
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym 'V3_4'
end
Moreover, if you want to change Api
namespace to API
, since it's an acronym, you can do it there as well:
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym 'V3_4'
inflect.acronym 'API'
end
More info: http://api.rubyonrails.org/classes/ActiveSupport/Inflector/Inflections.html