Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Admin routes using components #cobra #cbra (with admin per engine, unique engine paths, and meta admin engine)
mount Settings::Engine => "/settings"
mount Profile::Engine => "/profile"
mount MetaAdmin::Engine => "/admin"
# admin_settings/config/routes.rb
Settings::Engine.routes.draw do
resources :admin
#add other settings routes
# profile/config/routes.rb
Profile::Engine.routes.draw do
resources :admin
#add other profile routes
# in initializers in profile and settings engines:
if const_defined?("MetaAdmin", false)
MetaAdmin.adminable_components_paths << { ENGINE_NAME::Engine => "/admin" }
# then you could access
# /profiles/admin
# /settings/admin
# /admin
# and the meta-admin could create a unified interface for all admin protions of all components using `adminable_components_paths`
Copy link

shageman commented Jan 27, 2015

Alternative to for creating one admin experience from multiple engines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment