简体   繁体   English

如何从命令行对目录进行这些更改? (RoR)

[英]How do I make these changes to my directory from the command line? (RoR)

Currently our post resources are nested under topics. 目前,我们的帖子资源嵌套在主题下。 We should organize our posts_controller and post views in the same manner. 我们应该以相同的方式组织posts_controllerpost views Make the following directory changes: Try to make these changes from your command line. 进行以下目录更改:尝试从命令行进行这些更改。

app/controllers/posts_controller.rb -> app/controllers/topics/posts_controller.rb

How do I make the changes using the command line? 如何使用命令行进行更改?

$ mkdir app/controllers/topics
$ mv app/controllers/posts_controller.rb app/controllers/topics/posts_controller.rb

Generically, you'd want to use mkdir -p in case app/controllers/topics exists already. 通常,如果app / controllers / topics已经存在,则要使用mkdir -p

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM