Skip to content

uninitialized constant SwaggerController #5

@coldnebo

Description

@coldnebo

Hi, followed the example on the main README and got this error:

Started GET "/appname/swagger/api" for 127.0.0.1 at 2014-09-04 11:08:22 -0400

ActionController::RoutingError (uninitialized constant SwaggerController)

my app is mapped to /appname/swagger/api via config.ru instead of '/swagger/api'.

if defined?(WEBrick)
  map ActionController::Base.config.relative_url_root || '/' do
    run Appname::Application
  end
else
  run Appname::Application
end

I added to the routes.rb as advised:

mount SwaggerYard::Engine, at: "/swagger"

and rake routes shows the new routes, correctly.

$ rake routes
  ...
  swagger_yard_engine      /swagger                   SwaggerYard::Engine

Routes for SwaggerYard::Engine:
doc GET /doc(.:format)           swagger#doc
api GET /api(.:format)           swagger#index
    GET /api/*resource(.:format) swagger#show

Do I need an addtional require?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions