为什么" rails生成控制器"实际上没做什么?

时间:2017-08-25 19:51:16

标签: ruby-on-rails controller ruby-on-rails-5

我使用的是Rails 5.0。我想生成一个控制器,所以我想我会使用" rails generate controller"命令。然而,虽然它说它创建了控制器(以及一堆其他文件),但它们不在我的文件系统中。请参阅下面的输出和ls命令。我做错了什么?

localhost:cindex davea$ rails generate controller UserNotifications
Running via Spring preloader in process 97745
      create  app/controllers/user_notifications_controller.rb
      invoke  erb
      create    app/views/user_notifications
      invoke  test_unit
      create    test/controllers/user_notifications_controller_test.rb
      invoke  helper
      create    app/helpers/user_notifications_helper.rb
      invoke    test_unit
      invoke  assets
      invoke    coffee
      create      app/assets/javascripts/user_notifications.coffee
      invoke    scss
      create      app/assets/stylesheets/user_notifications.scss
localhost:cindex davea$ vim app/controllers/
application_controller.rb  concerns/                  pages_controller.rb
localhost:cindex davea$ ls app/controllers/user_notifications_controller.rb
ls: cannot access 'app/controllers/user_notifications_controller.rb': No such file or directory

0 个答案:

没有答案