0

私はこれらのURLを持っています:

http://localhost:3000/assets
http://localhost:3000/assets/new
http://localhost:3000/assets/34
http://localhost:3000/assets/34/edit

彼らは私のアプリで動作します。

私はこのroutes.rbファイルを持っています:

devise_for :users

match "listings/show_notes" => "listings#show_notes", :as => :show_notes

resources :users

resources :listings

resources :assets

 authenticated :user do
  root :to => "listings#index"
 end

#this route is for file downloads
 match "assets/get/:id" => "assets#get", :as => :download

 resources :admin_dash_board,  :only => :index

レーキルートを入力すると、次の出力があります

 new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
        user_session POST   /users/sign_in(.:format)       devise/sessions#create
 destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
       user_password POST   /users/password(.:format)      devise/passwords#create
   new_user_password GET    /users/password/new(.:format)  devise/passwords#new
  edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                     PUT    /users/password(.:format)      devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)            devise/registrations#cancel
   user_registration POST   /users(.:format)               devise/registrations#create
   new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
 edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                     PUT    /users(.:format)               devise/registrations#update
                     DELETE /users(.:format)               devise/registrations#destroy
          show_notes        /listings/show_notes(.:format) listings#show_notes
               users GET    /users(.:format)               users#index
                     POST   /users(.:format)               users#create
            new_user GET    /users/new(.:format)           users#new
           edit_user GET    /users/:id/edit(.:format)      users#edit
                user GET    /users/:id(.:format)           users#show
                     PUT    /users/:id(.:format)           users#update
                     DELETE /users/:id(.:format)           users#destroy
            listings GET    /listings(.:format)            listings#index
                     POST   /listings(.:format)            listings#create
         new_listing GET    /listings/new(.:format)        listings#new
        edit_listing GET    /listings/:id/edit(.:format)   listings#edit
             listing GET    /listings/:id(.:format)        listings#show
                     PUT    /listings/:id(.:format)        listings#update
                     DELETE /listings/:id(.:format)        listings#destroy
                root        /                              listings#index
  admin_dash_board_index GET    /admin_dash_board(.:format)    admin_dash_board#index

ご覧のとおり、リソース:assetsのルートはありません。

なぜですか?または何が起こっているのですか?

ありがとう

4

1 に答える 1

2

私はあなたの答えをここここで見つけたと思います。

次の行を に追加してみてくださいapplication.rb:

config.assets.prefix     = "/new_route"

編集-問題を解決するための他のオプションもここにあります....

于 2012-06-18T16:30:21.560 に答える