简体   繁体   中英

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:

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. It still works for my Rails 3 apps.

:assets is a reserved path in Rails. So you cannot really use it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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