TrestleAdmin / trestle

A modern, responsive admin framework for Ruby on Rails
https://trestle.io
GNU Lesser General Public License v3.0
1.96k stars 177 forks source link

How to create several menu items for different scopes ? #285

Open lphm opened 4 years ago

lphm commented 4 years ago

I have an Admin Resource that have many scopes. I would to create several menu items in my admin resource who targets each scopes.

For example : menu item "suppliers" open scope "suppliers" menu item "customers" open scope "customers"

By this way I would to targets differents Admin resources tables (menu item "leads" targets table "leads" into an Admin Resource). Thanks

LinhaiShen commented 3 years ago

I have 2 options for you:

  1. It looks like a "Single Table Inheritance" scenario, you can generate sub-classes e.g. "Supplier" and "Customer", then you got what you want.
  2. create supplier_admin.rb and customer_admin.rb files with different menus and same resource, but handle index/show/new actions with your scopes.