I would like to create a new controller that will allow the admin user to edit models attached to users outside of rails admin. Here is a sample from my routes.rb:
devise_for :admins
mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
devise_for :dealers
devise_for :users
get "..." => "..."
etc
What do I need to do in both my controller and in routes.rb to make this possible? I’m fairly new to Rails. Thanks! I have a limited amount of time so making a rails-admin plugin is not feasible.
In your controller check if an admin is loged in using
admin_signed_in?, and you can also access it bycurrent_admin. So you just have to place conditions checking if it’s and admin to enable or not those functionalities.EDIT:
You can have something like this in your before_filter