我已經創建了一個新的rails 4引擎,並嘗試爲新創建的引擎工作沒有安裝路線,但它在下面沒有爲我工作的文件。Rails 4引擎沒有加載根路線的路線
應用程序/ routes.rb中(根路由文件)
Rails.application.routes.draw do
mount Uhoh::Engine => "/uhoh"
resources :products
end
NEW_ENGINE /配置/ routes.rb中(發動機路由文件)
Uhoh::Engine.routes.draw do
get "failures#index"
end
uhoh/LIB/uhoh/engine.rb(引擎文件)
module Uhoh
class Engine < ::Rails::Engine
isolate_namespace Uhoh
end
end
,但是當我遇到來自treminal「回扣路線」命令,則它不會顯示從「Uhoh」演義路線東北。
Prefix Verb URI Pattern Controller#Action
uhoh /uhoh Uhoh::Engine
products GET /products(.:format) products#index
POST /products(.:format) products#create
new_product GET /products/new(.:format) products#new
edit_product GET /products/:id/edit(.:format) products#edit
product GET /products/:id(.:format) products#show
PATCH /products/:id(.:format) products#update
PUT /products/:id(.:format) products#update
DELETE /products/:id(.:format) products#destroy
Routes for Uhoh::Engine:
是在'uhoh /配置/ routes.rb'您Uhoh路線文件? – etdev
是的,它是在uhoh/config/routes.rb – user3906755