简体   繁体   中英

Active Admin Customization in Ruby On Rails

I'm using active admin gem. In one table i want admins page to have some extra fields apart from the default functionalities. Is it possible to have a default active admin page + a provision to render some html.

I want something like this in picture 在此处输入图片说明

The extra feature that i was talking was about push notification and message and that text area part

If you want a page with your own content, you could register a page: http://www.activeadmin.info/docs/10-custom-pages.html

But if you want to customise the default html strucure of the index page, you have to re-open the ActiveAdmin::Views::Pages module and override the build_page_content method. You can do this inside your app, for example create a new file in app/lib folder and override the method.

https://github.com/gregbell/active_admin/blob/master/lib/active_admin/views/pages/base.rb#L62

or if you want to customise the index table: https://github.com/gregbell/active_admin/blob/master/lib/active_admin/views/pages/index.rb

Not a nice solution, but it's work. :/

Unfortunately, it seems index doesn't support custom rendering: https://github.com/gregbell/active_admin/issues/813#issuecomment-3059957

However, you might have luck using panel , except in my experience that renders above the table ActiveAdmin generates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM