How to add button to ActiveAdmin's index page

烈酒焚心 提交于 2019-12-19 15:14:17

问题


I created a collection action for ActiveAdmin rescource and want to link to it from the resource index page.

But how do I customize the resource index page?

The manual gives some options, but none to add html / buttons on the page (or I cannot see where).

http://activeadmin.info/docs/3-index-pages.html


回答1:


You can create buttons on index page with action_item block:

action_item only: :index do
  link_to 'Button text', post_path(post)
end

https://github.com/activeadmin/activeadmin/blob/master/docs/8-custom-actions.md#action-items



来源:https://stackoverflow.com/questions/26547726/how-to-add-button-to-activeadmins-index-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!