0

I want to create two admin views by using rails_admin gem. I created one admin and i specify the path( mount RailsAdmin::Engine => '/admin', :as => 'rails_admin' in routes.rb).

Similarly I specified another path (mount RailsAdmin::Engine => '/superadmin', :as => 'superadmin' ).

Now I am getting the same views for both superadmin and admin view. I used devise and cancan for authentication.

But I want to seperate the model in 2 views. I don't know where to make changes.
In config/initializers/rails_admin.rb I included some models but it is reflected in both admin views.

How to accomplish this?

Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

0

You cant achieve that using rails_admin. I've tried couple of months ago and found its not made for that.

Currently I am using rails_admin for SuperAdmin as its required less customization.

And

I am using active_admin for normal administration.

Muntasim
  • 6,689
  • 3
  • 46
  • 69
0

Rails admin lets you customize stuff by user but you'll have to do a tedious configuration for all your models. If you want super fine grained customization. For example

edit do
  field :avatar do
    visible do
      bindings[:view]._current_user.id
    end
  end
end

You can always use cancancan and customize your can read permissions depending on the type of user, rails_admin will honor them.

Guillermo Siliceo Trueba
  • 4,251
  • 5
  • 34
  • 47