我已经创建了一个新的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