I’m making an application using rails and activeadmin. I want to use the same interface for both admin and non-admin users.
Is it possible to call the methods show, index, column, attribute_table, etc, from outside activeadmin?
For example, I’d like to make an index page for users like this:
<%= index @users do
column :name
column :last_name
column :email do |user|
link_to user.email , user_path(user)
end
column :status
end %>
It is possible to define the whole application with ActiveAdmin.
Steps:
Define methods for authentication and current user depending on the namespace:
Configure folders:
Define pages and resources for admins under
app/adminusingActiveAdmin.register Resource doandActiveAdmin.register_page 'Page name' doDefine pages and resources for non-admin users under
app/usersusingActiveAdmin.register Resource , namespace: false doandActiveAdmin.register_page 'Page name' , namespace: false do