简体   繁体   English

Rails 4未在“耙路”中显示路线,但视图正在运行

[英]Rails 4 not showing routes in 'rake routes' but views are working

Pretty much as the title states, I have the following in my routes file: 几乎如标题所述,我的路由文件中包含以下内容:

  root to: 'assets#index'

  resources :assets do
    member do
      get :download
    end
  end

Yet my output for rake routes and visiting rails/info/routes are both simply: 但是我的rake routes和访问rails/info/routes的输出都只是:

Prefix Verb URI Pattern Controller#Action
root GET / assets#index

However the routes work fine in my views. 但是在我看来,这些路线运转良好。

I also tried with bundle exec and I've updated to the latest version of bundle as some other posts suggested. 我还尝试了bundle exec并已将其更新为最新版本的bundle,如其他一些帖子所建议的那样。 It still works for my Rails 3 apps. 它仍然适用于我的Rails 3应用程序。

:assets is a reserved path in Rails. :assets是Rails中的保留路径。 So you cannot really use it. 因此,您无法真正使用它。

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

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