Uninitialized constant “Controller Name”

前端 未结 4 1751
终归单人心
终归单人心 2021-01-17 08:13

I\'m having an error with my routes/resources and controllers.

I have the following in the routes.rb:

# routes.rb
resources :users do  
  resource :s         


        
4条回答
  •  不知归路
    2021-01-17 08:33

    It should be SchedulesController, not Users::ScheduleController. Controllers should only be namespaced when the route is namespaced with namespace. Controller names should also always be plural.

    What you're creating is a nested resource, not a namespaced one.

提交回复
热议问题