Engine full vs mountable
full
# my_engine/config/routes.rb
Rails.application.routes.draw do
# ...
endmountable
# my_engine/config/routes.rb
MyEngine::Engine.routes.draw do
# ...
end
# parent_app/config/routes.rb
ParentApp::Application.routes.draw do
mount MyEngine::Engine => "/engine", :as => "namespaced"
end推荐使用 mountable
最后更新于