I have created a new rails 4 Engine and try to work no mount routes for the newly created Engine but it did not worked for me below are the files.
app/routes.rb (root routes file)
Rails.application.routes.draw do
mount Uhoh::Engine => "/uhoh"
resources :products
end
new_engine/config/routes.rb (Engine routes file)
Uhoh::Engine.routes.draw do
get "failures#index"
end
uhoh/lib/uhoh/engine.rb (engine file)
module Uhoh
class Engine < ::Rails::Engine
isolate_namespace Uhoh
end
end
but when I have run "rake routes" command from treminal then it does not show the routes from the "Uhoh" engine.
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: