-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More than one resource_admin to the same model #370
Comments
I believe you can have as many admin pages to the same resource as pleased. #first_admin_page.rb
collection do
model.where(flag: true)
end #second_admin_page.rb
collection do
model.where(flag: false)
end |
You can easily with app/admin/test_product_admin.rb app/admin/real_product_admin.rb And so on. Then you can limit data as stated above, permissions and behaviors. Using this way on production without any problems |
I just faced admin_link_to issue when declaring multiple resources with model: User. Solved it with this ugly hack: # app/admin/users_admin.rb
# put this code before Trestle.resource(:user)
# HACK: Ensure this admin module is registered as
# primary User model page and admin_link_to User keep refering here.
# Prevents conflict with YouNameConflictingAdminModule
Trestle.registry.instance_variable_get(:@models).delete('User') In case your admin page is not about users - change it to your needs accordingly. |
@Fedcomp Use the Trestle.resource(:secondary_users, register_model: false) do
...
end This will ensure that this resource is not used for automatic model lookup when using the |
Hi ! Is it any possibility to create more than one admin resource to the same model ? Due to status (value of attribute (boolean) : true, false ) of objects in my model I need two menu items for managing of each parts of objects. Thanks for any answers.
The text was updated successfully, but these errors were encountered: