【发布时间】:2016-03-11 16:02:45
【问题描述】:
我有几个问题,如果我可以将它们全部捆绑到这里,这可能是一个很好的参考。
我想在 [posts/show] 中呈现部分 [cmets/new]。现在在我们当前的页面/显示帖子#show 上,我们将使用 posts_controller.rb 我们的模型将是我们想要在任何时候调用的模型。 -- 我需要在 [posts/show] 中渲染 [cmets/new] 并启用 cmets_controller.rb。
其次,rake 路由会显示为您创建的路由列表。
post_comments GET /posts/:post_id/comments(.:format) comments#index
POST /posts/:post_id/comments(.:format) comments#create
new_post_comment GET /posts/:post_id/comments/new(.:format) comments#new
edit_post_comment GET /posts/:post_id/comments/:id/edit(.:format) comments#edit
post_comment GET /posts/:post_id/comments/:id(.:format) comments#show
PATCH /posts/:post_id/comments/:id(.:format) comments#update
PUT /posts/:post_id/comments/:id(.:format) comments#update
DELETE /posts/:post_id/comments/:id(.:format) comments#destroy
不确定此列表中的所有内容是什么或它是如何工作的,需要一些帮助。
类和子类?你能有子子类吗?如何在一个简单的应用程序中链接一个类和一个子类。
【问题讨论】:
标签: ruby-on-rails ruby routes nested