When trying to access the following URL, I get a 404 error page:
dev.mydomain.com/api
whereas my routes.rb file mentions that this route does exist:
routes.rb
constraints :subdomain => 'dev' do
root :to => 'developers/main#index', :as => :developers
namespace 'api', :as => :developers_api do
root :to => 'developers/apidoc/main#index'
end
end
rake routes
developers /(.:format) {:subdomain=>"dev", :controller=>"developers/main", :action=>"index"}
developers_api_root /api(.:format) {:subdomain=>"dev", :controller=>"api/developers/apidoc/main", :action=>"index"}
controller
/app/controllers/developers/apidoc/main_controller.rb
class Developers::Apidoc::MainController < Developers::BaseController
def index
end
end
logs
[router]: GET dev.mydomain.com/api dyno=web.1 queue=0 wait=0ms service=14ms status=404 bytes=0
[web.1]: Started GET "/api"
[web.1]: ActionController::RoutingError (uninitialized constant Api::Developers)