且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Rails 应用程序看不到我的观点

更新时间:2023-11-17 21:37:52

这很可能是由于您的路由没有正确配置造成的.所以看看你的 routes.rb 的内容会很有帮助

This is most likely caused by your routes not being correctly configured. So it would be helpful to see the content of your routes.rb

在您的情况下,我认为配置路由的***方法是使用资源映射:

In your case I think the best way to configure the routes is to use the resources mapping:

resources :subjects

这将默认为标准 RESTful 操作创建路由:index、:show、:edit、:update、:new、:create 和 :destroy.

This will by default create routing for the standard RESTful actions :index, :show, :edit, :update, :new, :create and :destroy.

有关路由的更多详细信息,我建议Rails 从外向内路由

For more detailed information about the routing, I would recommend Rails Routing from the Outside In